Re: Simple error handling... but how?
| From: | Chris Lee | Date: | Mon, 08 Jan 2001 22:28:12 +0000 |
| Subject: | Re: Simple error handling... but how? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33333@lists.php.net to get a copy of this message | ||
I can see the advantage of useing your own error handler, I havent played
alot with it and havent got it working. If a person has 100 lines of code
and if there is even one error you want a simple error displayed and to stop
the loading of the page. You dont want to put '@' in front of every line of
code, and then do 100 if statements to check for errors, the code would be
huge.
Chris Lee
Mediawaveonline.com
"Brian Clark" <brianj@fusionwerks.com> wrote in message
news:4577030266.20010108170109@fusionwerks.com...
>
> Hello Diego,
>
> (DF == "Diego Fulgueira") dful@metahogar.com writes:
>
> DF> Ok. This might have been widely discussed already, but I haven't
> DF> been able to find useful information about it: How can I present a
> DF> customized error page whenever a PHP error or warning ocurrs?
>
> Just suppress errors with @ in front of a function name, and display
> your error instead.
>
> Ie:
>
> if(! @mysql_query($query, $link))
> {
> $errorMsg = 'Unable to update the database record ';
> $errorMsg .= 'because: <font color="neonpink">';
> $errorMsg .= mysql_error() . '</font>';
> print $errorMsg;
> }
>
> You get the idea..
>
> -Brian
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>