note 74854 added to language.exceptions
| From: | corrupted_wise at yahoo dot com | Date: | Mon, 30 Apr 2007 23:37:26 +0000 |
| Subject: | note 74854 added to language.exceptions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126000@lists.php.net to get a copy of this message | ||
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();
?>
----
Server IP: 64.71.164.2
Probable Submitter: 166.150.191.246
----
Manual Page -- http://www.php.net/manual/en/language.exceptions.php
Edit -- https://master.php.net/note/edit/74854
Del: integrated -- https://master.php.net/note/delete/74854/integrated
Del: useless -- https://master.php.net/note/delete/74854/useless
Del: bad code -- https://master.php.net/note/delete/74854/bad+code
Del: spam -- https://master.php.net/note/delete/74854/spam
Del: non-english -- https://master.php.net/note/delete/74854/non-english
Del: in docs -- https://master.php.net/note/delete/74854/in+docs
Del: other reasons-- https://master.php.net/note/delete/74854
Reject -- https://master.php.net/note/reject/74854
Search -- https://master.php.net/manage/user-notes.php