Re: [RFC] Exceptions in the engine
| From: | Benoit Schildknecht | Date: | Sat, 14 Feb 2015 00:32:01 +0000 |
| Subject: | Re: [RFC] Exceptions in the engine | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-82653@lists.php.net to get a copy of this message | ||
Hi,
Le Sat, 14 Feb 2015 00:25:12 +0100, Nikita Popov <nikita.ppv@gmail.com> a écrit:
The question of whether EngineException should inherit from Exception is something we do have to consider now. Personally I prefer not introducing any special exception types that aren't caught by default. I think that 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 make it a voting option. Commentary on these, and also any other relevant points is very welcome! Thanks, NikitaI 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 chance 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.