Re: error message handling
| From: | Alex Black | Date: | Wed, 17 Jan 2001 19:57:42 +0000 |
| Subject: | Re: error message handling | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-35128@lists.php.net to get a copy of this message | ||
> You probably want to suppress the error message with an @ symbol. Try
> putting an "@" before the function calls that give you errors.
you want to avoid doing that, I recommend properly handling the error.
> <?php
> $x = @php_function_here();
> ?>
>
> This suppresses the error function. Many functions return FALSE if
> unsuccessful, so you can test and supply your own error message.
better to write a handler to deal with your errors properly.
> <?php
> if ($x == FALSE) {
> print ("error.");
> }
> ?>
>
> If you find yourself doing this alot, you may want to create a wrapper
> function or wrapper class around the original. Look at PHPLIB's DB_SQL
> class for an example of how they suppress error messages. Look at
> www.php.net for more info.
or have a look at binarycloud: http://www.binarycloud.com
best,
_alex