note 74854 deleted from language.exceptions by bjori
| From: | bjori@php.net | Date: | Fri, 28 Nov 2008 17:28:56 +0000 |
| Subject: | note 74854 deleted from language.exceptions by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147083@lists.php.net to get a copy of this message | ||
Note Submitter: corrupted_wise at yahoo dot com
----
There was a certain section of my code that I needed to completely ignore if it failed. So I
trapped it all in a try/catch and utilized the set_error_message, which in essence is like a
pseudo-goto clutch. The reason for it all was if it failed during the code, I didn't want it
to execute the rest of the respective section but continue outside of it. In the hopes it might
help someone else out, here's what I did.
I'm using PHP 5.2.1
<?php
....
try {
set_error_handler(create_function('', "throw new Exception(); return true;"));
...code...
} catch(Exception $e) {
}
restore_error_handler();
?>