Hi Saša,
Basically, if the exception isn't thrown within the dispatch loop, you
would have to catch the exception in your index.php and dispatch to your
error controller yourself. To make sure your errors and notices etc are
thrown as exceptions you would need an error handler like mine.
Roughly something like this:
try {
$front->dispatch(); // (or $app->bootstrap()->run())
}catch(Exception $e) {
$request = new Zend_Controller_Request_Simple('error', 'error');
$front->dispatch($request);
}
Maybe you would need to reset the dispatcher, but best way to find out
it's been done is read the source code of the
Zend_Controller_Plugin_ErrorHandler
But still, I'd advise against it and handle errors at this level without
your error controller, because it is quite possible the error will come
up just another time in the catch() block, and you would still have to
catch that one and handle it. You would of course want to eliminate
every possibility your error handler itself is faulty.
drm / Gerard
Саша Стаменковић wrote:
Thx. But I can't see how this can help :P
Regards,
Saša Stamenković
On Thu, Sep 24, 2009 at 3:00 PM, Vincent de Lau <vinc...@delau.nl
<mailto:vinc...@delau.nl>> wrote:
> What i did was writing a function that simply throws an
exception and
> passing that function to set_error_handler, something like this:
>
> error_reporting(E_ALL);
> function exceptionThrower($type, $errMsg, $errFile, $errLine) {
> throw new Exception($errMsg);
> }
> set_error_handler('exceptionThrower');
You should check out: http://php.net/ErrorException
It is an Exception type tailored to PHP's errors.
Vincent de Lau
vinc...@delau.nl <mailto:vinc...@delau.nl>