Re: some thoughts on error handling (anyone replied?)

From: Date: Thu, 29 Mar 2001 00:25:50 +0000
Subject: Re: some thoughts on error handling (anyone replied?)
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-487@lists.php.net to get a copy of this message
Well, actually, just because I was lazy for phase 1. ;) I'm actually going to go back in and polish up stuff like that now that the site is up, and a good foundation is laid for changes like this. :) -Jason ----- Original Message ----- From: "Andrei Zmievski" <andrei@ispi.net> To: "Jason Alexander" <j-l-alexander@home.com> Cc: <smarty@lists.ispi.net> Sent: Wednesday, March 28, 2001 11:04 AM Subject: Re: [smarty] Re: some thoughts on error handling (anyone replied?) > On Wed, 28 Mar 2001, Jason Alexander wrote: > > /*! > > This function handles all aspects of errors in the system. > > */ > > function userErrorHandler ($errno, $errmsg, $filename, $linenum, $vars) { > > > > $template = new Smarty(); > > > > $sErrorMessage = "Error encountered!<br>" . > > "<br>" . > > "Err no: " . $errno . "<br>" . > > "Err Msg:<br> " . $errmsg . "<br><br>" . > > "Filename: " . $filename . "<br>" . > > "Line num: " . $linenum . "<br>" . > > "Vars: " . $vars . "<br>"; > > > > mail($admin_email_addr, "MFFL: Error caught.", $sErrorMessage, "From: > > sitemonitor@mavsfanforlife.com"); > > > > $template->assign("error_desc", $sErrorMessage); > > $template->assign("action_desc", "access the site"); > > > > $template->display("index.tpl"); > > > > die(); > > > > > > } > > > > // Reset the error handle to use this error handler. > > $old_error_handler = set_error_handler("userErrorHandler"); > > > > > > I have a base error template that basically says, "There was an error while > > attempting to {$action_desc}. The details of the error are: {$error_desc}". > > I'm curious, why is "access the site" hardcoded in the error handler? > What if you want your action description to be different? > > -Andrei > * Why is it always Segmentation's fault? *

« previous php.smarty.general (#487) next »