Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82653 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33478 invoked from network); 14 Feb 2015 00:32:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2015 00:32:08 -0000 X-Host-Fingerprint: 79.94.237.143 143.237.94.79.rev.sfr.net Received: from [79.94.237.143] ([79.94.237.143:18888] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/03-15073-6879ED45 for ; Fri, 13 Feb 2015 19:32:08 -0500 To: internals@lists.php.net Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes References: Date: Sat, 14 Feb 2015 01:32:01 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable Message-ID: User-Agent: Opera Mail/1.0 (Win32) X-Posted-By: 79.94.237.143 Subject: Re: [RFC] Exceptions in the engine From: bensor987@neuf.fr ("Benoit Schildknecht") Hi, Le Sat, 14 Feb 2015 00:25:12 +0100, Nikita Popov = a = =C3=A9crit: > The question of whether EngineException should inherit from Exception = is > something we do have to consider now. Personally I prefer not introduc= ing > any special exception types that aren't caught by default. I think tha= t > would only make sense for errors that could occur literally everywhere= > (like memory limit or timeout), but these are not handled by this RFC = for > technical reasons. If someone has a strong opinion on this, I might ma= ke = > it > a voting option. > > Commentary on these, and also any other relevant points is very welcom= e! > > Thanks, > Nikita > I don't think EngineException should inherit from Exception, it would be= = very dangerous. I'm sure a lot of exceptions are handled like this by a = = lot of devs, without creating custom exceptions : try { } catch ( Exception $e ) { } Making EngineException inherit from Exception means that there is a chan= ce = it will change the behavior of this kind of code, maybe breaking some = crucial datas in database or such. Instead, I think Exception should inherit from EngineException. Or = anything else. Regards, Benoit.