[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-general
Subject:    [smarty] Re: some thoughts on error handling (anyone replied?)
From:       "Jason Alexander" <j-l-alexander () home ! com>
Date:       2001-03-29 0:25:50
[Download RAW message or body]

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? *


---
You are currently subscribed to smarty as: smarty@progressive-comp.com
To unsubscribe send a blank email to leave-smarty-700385W@lists.ispi.net
Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic