On Tue, 14 Jan 2003 23:38:11 +0100, you wrote: >Hi all, > >is there a way to execute a custom function as soon as an error happens in >PHP? I looked at the set_error_handler function, but it doesn't seem to trap >all the errors. What I want to achieve is to execute a function that mails >me the error everytime an error happens.
My site has a custom error handler (implemented via set_error_handler) which sends a nicely formatted email including all of the error details, a variable dump, the contents of the output buffer before the error occured, and the contents of a call to debug_backtrace, in addition to logging the error to a file. We've used it in some form or another for nearly a year now and it's been very helpful. set_error_handler effectively traps every error you're likely to encounter with the exception of parse errors. And if you have a script with a parse error, you'll know it pretty quickly and likely won't need to be emailed, which means that for all intents and purposes, set_error_handler traps all errors. Is there a specific problem you're having with set_error_handler, or a specific error that you were hoping your custom function would catch that is isn't? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php