note 57304 added to language.exceptions

From: Date: Fri, 30 Sep 2005 05:17:48 +0000
Subject: note 57304 added to language.exceptions
Groups: php.notes 
Request: Send a blank email to php-notes+get-96023@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/language.exceptions.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57304 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57304&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57304&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57304&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57304&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57304&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57304&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57304&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57304&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#96023) next »