NYCPHP Meetup

NYPHP.org

[nycphp-talk] NEW PHundamentals Question - Error Handling

Jeff Siegel jsiegel1 at optonline.net
Mon May 10 13:33:13 EDT 2004


Putting PEAR aside for the moment, how should someone use those three 
PHP functions? For example, if someone uses trigger_error(), then what?

Jeff S.

David Mintz wrote:

> 
> No discussion is complete without mentioning PHP's native error and
> logging functions (http://us3.php.net/manual/en/ref.errorfunc.php),
> especially set_error_handler(), error_reporting(), trigger_error()
> 
> No discussion is complete without mentioning PEAR_Error which offers a lot
> of flexible and convenient means of error handling
> (http://pear.php.net/manual/en/core.pear.pear-error.php)
> 
> One of the criticims of languages that don't have real exception handling
> (try/catch/finally) is that checking the return value of every call gets
> tedious and hard to read. One of the things I like about Pear is that you
> can set an error handling callback function, and then go ahead and run a
> few lines of e.g. database stuff without bothering line-by-line.
> 
> Another point that bears mentioning -- since this is a Fundies thread --
> is whether and how much error output to display it the browser in
> development versus production, from the security standpoint as well as
> style. Development:  verbose and informative. Production: apologetic and
> vague.
> 
> Perhaps it also bears mentioning by way of Fundies that if you have error
> reporting on and warnings on, you can still supress error output on a
> per-function-call basis by prepending an @ to the function name.
> 
> 
> I would (and could) elaborate on all of the above but I just wanted to get
> a shot in before someone else beat me to it (-:
> 
> ---
> David Mintz
> http://davidmintz.org/
> 
>         "Anybody else got a problem with Webistics?" -- Sopranos 24:17
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 




More information about the talk mailing list