Re: Catching all errors and redirecting

From: Date: Thu, 18 Aug 2005 18:14:13 +0000
Subject: Re: Catching all errors and redirecting
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-220886@lists.php.net to get a copy of this message
Thomas Hochstetter wrote:
Hi again, Is it possible to catch all parser errors (notices), and as that happens redirecting to a 'sorry-page-not-available-at-this-moment' page, whilst storing the error (or notice) message somewhere else (e.g. emailing it to the developer).
Parse errors, no. When the script won't parse, it can't run, so there's no way to capture the error with php. Other errors (mysql, can't open file, etc). Yes. Most functions will return something upon execution (the result you want on success, false/null on failure). Capture that. Notices? Turn that off in the php.ini for production. You can also have php log the errors. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com

« previous php.general (#220886) next »