Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91782 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50732 invoked from network); 19 Mar 2016 21:09:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2016 21:09:10 -0000 Authentication-Results: pb1.pair.com header.from=pierrick@webstart.fr; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=pierrick@webstart.fr; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain webstart.fr from 209.85.161.172 cause and error) X-PHP-List-Original-Sender: pierrick@webstart.fr X-Host-Fingerprint: 209.85.161.172 mail-yw0-f172.google.com Received: from [209.85.161.172] ([209.85.161.172:35659] helo=mail-yw0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9F/00-48999-3FFBDE65 for ; Sat, 19 Mar 2016 16:09:09 -0500 Received: by mail-yw0-f172.google.com with SMTP id g127so177297248ywf.2 for ; Sat, 19 Mar 2016 14:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=webstart-fr.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=IvjlxL4+M+av671828PfcRnlKC8f/DW7sG0mEd/FG/I=; b=jbevzY7vZoz2c8qmjFej62cQ3rh2HqeV9qGl9cB2oMEpEd3VaWj6S94O8L9zljZAo2 oVhsSqkFJtbPh2TNXM9JMKbtiAqhpvKT7vTs/ZSJgC1W7XCimxbv8JGKMArNphkPR7QS jIZrHi720BZNcKA8vioHDPYgdSp1zH+PqFCrTvGFb7t+TpyYZynzghIkuSCvtRod9f3S 956hluVtwzlvkR3ZlNK3NPmhgLpVwsU1RJM1uj+42nctv83hNUT6Gmrt7kD3znE+T2td KDBYaBv2i2kkYAOS2kYCdahoivNxc/hq0gU3aBh8V/e0l6S/KmRX9GYTTz3n2ZP9MfUQ zJog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=IvjlxL4+M+av671828PfcRnlKC8f/DW7sG0mEd/FG/I=; b=c83iBzuMk5nK5nX4alwH8UG1HuZjHzW82yQlJiTjfd8Yi5EnvwsXIXsZl7846AYNMu cRFwyg4NUDxwdWVg5sLRMikzpFOnT0n2upumE7ZM1oJaBtotCEDR+5JNN3PpYJlHc7D+ 1/g2px9vcqWj1HOl6QHzb8QQhZzcbVMAQxMbcwi+0Sqa05y8T1J1F1g2xnfPqBA0Pbxw X8vrhlxIH9U41Y65TQvsJUT9qqObFddAHmMqZospikvV/35l25e1XzZnU5+JBhFkKRkO onA6tNaTokTfoS3a381m3ChdWysRCY5GOt1RHPdwVz9UXlZL39Ej6yTf7xLkbIh8CmeJ K3tg== X-Gm-Message-State: AD7BkJK1HTXr8n7Eqzs9Xzvf3ifLYBubwCt7a84qffbtuoTrSkE6WLhj915MWs5RgbiV/zw64mY41hP56I5bEw== MIME-Version: 1.0 X-Received: by 10.37.230.136 with SMTP id d130mr10584549ybh.125.1458421745534; Sat, 19 Mar 2016 14:09:05 -0700 (PDT) Sender: pierrick@webstart.fr Received: by 10.37.76.130 with HTTP; Sat, 19 Mar 2016 14:09:05 -0700 (PDT) In-Reply-To: References: Date: Sat, 19 Mar 2016 17:09:05 -0400 X-Google-Sender-Auth: UxVxzrv3Jr4_LoIjEncWCmXjRNA Message-ID: To: Patrick ALLAERT Cc: Marco Pivetta , PHP internals , =?UTF-8?B?QnJvbmlzxYJhdyBCaWHFgmVr?= Content-Type: multipart/alternative; boundary=94eb2c0a9360138128052e6d46c1 Subject: Re: [PHP-DEV] [RFC Discussion] Catching multiple exception types From: pierrick@adoy.net (Pierrick Charron) --94eb2c0a9360138128052e6d46c1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks for the feedback Patrick :-) I understand your concern. I added a section to the RFC Impact section to mention that PHP tools/IDE will require some modifications. Feel free to add some additional details in this section if you want. People who will vote will then be aware of the situation and I'll of course comply to the voters decision :-) Pierrick On 15 March 2016 at 12:23, Patrick ALLAERT wrote: > Hi, > > Le mer. 9 mars 2016 =C3=A0 14:08, Marco Pivetta a = =C3=A9crit : > >> On 9 March 2016 at 14:03, Pierrick Charron wrote: >> >> > Hi Derick >> > >> > I agree that most of the time the best solution is to implement a clea= n >> > exception hierarchy but as stated in the RFC : >> > >> > "A solution to fix this problem on the user level would be to implemen= t >> a >> > common interface for ExceptionType1 and ExceptionType2 and catch it. >> > However, this is only possible when you control the exception hierarch= y >> in >> > your own code, but not possible when you don't control the code." >> > >> >> I understand the use-case, but I don't see it as a widespread scenario. = In >> most cases, I've been doing something like following: >> >> public function stuff() >> { >> try { >> $this->willFail(); >> } catch (FirstException $e) { >> $this->handleFailure($e); >> } catch (SecondException $e) { >> $this->handleFailure($e); >> } catch (ThirdException $e) { >> $this->handleFailure($e); >> } >> } >> >> Even then, this is a rare eventuality, and as pointed out above, usually >> fixed when wrapping exceptions correctly, if you have control over the >> exception types). >> Seems way below the 80/20 use-case to me, and introduces syntax changes = as >> well. > > > +1 > > I will add to this that Exceptions must remain... exceptional! Too much > projects relies already on tens or hundreds of business exception while > those are mostly common "error" conditions that are better handled with > dedicated API calls. > > To me, it doesn't look like a reasonable change when we consider the > number of tools/IDE to adapt compared to the possible usage of it. > > Cheers, > Patrick > --94eb2c0a9360138128052e6d46c1--