Re: Error handling
| From: | Roberto Mansfield | Date: | Thu, 01 Mar 2007 22:19:54 +0000 |
| Subject: | Re: Error handling | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-249679@lists.php.net to get a copy of this message | ||
Chris Ditty wrote:
> I am trying to add some error handling to my code. Instead of
> reinventing the wheel, I searched and found the code below. For the
> most part, it seems to work. When I have an error, it doesn't get
> shown. However, I don't get any output. I tracked it down to the
> $errno. It is outputting a number where the switch statement is
> expecting words. Short of typing an array converting number to
> words, what am I missing/doing wrong?
You also want to consider just giving the user a generic error message
and saving the full detailed error for the admin/developer. The details
in error messages are often useful in finding vulnerabilities in an app.
Roberto