note 57304 deleted from language.exceptions by bjori
| From: | bjori@php.net | Date: | Fri, 28 Nov 2008 17:25:46 +0000 |
| Subject: | note 57304 deleted from language.exceptions by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147079@lists.php.net to get a copy of this message | ||
Note Submitter: Carlos Konstanski
----
Being able to catch the exception up the call stack from where it is thrown is a good idea, in that
it lets you handle the exception closer to where it ought to be handled - in the calling code. Not
as good as common lisp though, where you can call a condition handler that resides up the stack
without actually unwinding the stack. With this additional feature, you have the lexical
environment at the point where the exception occured, combined with the relocation of the handler to
a place where the lower-level function's failure can be addressed from the standpoint of the
calling code.
Even so, this fluke of PHP that lets you place the try...catch block up the stack from the actual
point of error could be used to implement a neat shift in error-handling architecture, where the
caller gets to decide how to proceed after an error.