-- Dan Rossi <[EMAIL PROTECTED]> wrote
(on Saturday, 11 August 2007, 12:07 AM +1000):
> Matthew Weier O'Phinney wrote:
> > -- Dan Rossi <[EMAIL PROTECTED]> wrote
> > (on Friday, 10 August 2007, 12:01 PM +1000):
> >  
> > >Hi is this built in by default ? Ie trapping php errors and bubbling to 
> > >the error controller ?
> > >    
> >
> > Yes, by default the ErrorHandler plugin is enabled. However, you have to
> > create your own error handler controller for it to utilize; there are
> > examples in the Zend_Controller documentation.
> >
> Yes thats for exceptions, it bubbles up the error controller and I 
> handle it there. I meant for things like PHP warning ,  notices, fatal 
> (if thats possible now ? ) , if you know what I mean , or do I still 
> setup a error handler class for that.

You can only trap E_USER_*, E_NOTICE, E_WARNING, E_STRICT, and the new
E_RECOVERABLE_ERROR in an error handler; fatal, parse, and compile
errors cannot be trapped.

You typically don't want to trap stricts or notices, and you have to
pick and choose which warnings you really need to handle.

That said, I often create an error handler that checks the error type,
and if considered severe enough, throws it as an exception. This will
then be handled in your error handler controller.

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to