Re: [RFC] Exceptions in the engine

From: Date: Tue, 07 Oct 2014 12:15:55 +0000
Subject: Re: [RFC] Exceptions in the engine
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-77798@lists.php.net to get a copy of this message
On Tue, Oct 7, 2014 at 11:51 AM, Christian Stoller <stoller@leonex.de> wrote: > From: Dan Ackroyd [mailto:danack@basereality.com] ,Sent: Tuesday, October > 07, 2014 10:55 AM > > > > Stas wrote: > > > >> The only issue I think we need to discuss is catch(Exception $e). Now it > >> would catch much more than before, if we do no changes. > > > > It's not clear why would that be an issue - can you specify what the > > problem would be? > > > > Also, if we changed catch(Exception $e) to not catch all > > exceptions, > > than we would need to have another way of specifying that a catch > > block should catch all exceptions. Which would involve either making > > \Exception extend another even 'baser' Exception, or a hack to the > > syntax e.g. something like: > > > > catch($e) { > > // Catch without Exception type catches all exceptions > > // and confuses people. > > } > > > > cheers > > Dan > > Ack > > We could make EngineException to be parent of the base Exception class. > And, if it is technically possible, it must be forbidden to extend > EngineException directly in userland. > > This is just an idea. It would be a little bit strange if Exception is > not the base exception class ;) but it makes sense, because EngineException > is an exception of all other exceptions ^^ > > Christian > yes, this was also suggested before, but that will be also a BC break for those people already using the name of the new parent class ( https://github.com/search?l=php&q=EngineException&type=Code&utf8=%E2%9C%93 for example). which can be still an ok decision, I'm just stating/repeating the pro/cons as this was all discussed before. -- Ferenc Kovács @Tyr43l - http://tyrael.hu

« previous php.internals (#77798) next »