Re: [RFC] Exceptions in the engine
| From: | Stas Malyshev | Date: | Tue, 07 Oct 2014 18:00:21 +0000 |
| Subject: | Re: [RFC] Exceptions in the engine | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77816@lists.php.net to get a copy of this message | ||
Hi!
> 1) I'm not sure if "cacth(Exception $e)" should catch engine and parser
> exceptions. May be it's better to introduce interface or common parent
> class "Catchable" and then make Exception, EngineException and
> ParseException implement it. In case user would like to catch all the error
> at once they will able to use "catch(Catchable $e)", but cacth(Exception
> $e) would be 100% compatible.
We had some requests for 'Throwable' class/interface for some time, e.g.:
https://bugs.php.net/bug.php?id=48599
Maybe we could borrow something from Java here
(http://docs.oracle.com/javase/6/docs/api/java/lang/Throwable.html) -
not sure if it's the best way but it's an option.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/