List Info

Thread: note 74854 added to language.exceptions




note 74854 added to language.exceptions
user name
2007-04-30 18:37:26
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  -- h
ttps://master.php.net/note/delete/74854/integrated
Del: useless     -- http
s://master.php.net/note/delete/74854/useless
Del: bad code    -- htt
ps://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     -- http
s://master.php.net/note/delete/74854/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/74854
Reject      -- https://mast
er.php.net/note/reject/74854
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )