My application runs huge batch processing inside a Symfony task, and I want to be notified about all PHP errors and uncaught exceptions.
So I tried sfErrorNotifierPlugin, and it works great in a web context (accessing the application from the browser); the problem is that I can't make it work on my symfony tasks.
Is there any way to make it work in tasks?
Thank for your help @Maerlyn, my solution is not much different from yours.
I solved the problem overriding the doRun method on my tasks this way:
protected function doRun(sfCommandManager $commandManager, $options)
{
try
{
return parent::doRun($commandManager, $options);
}
catch (Exception $e)
{
$this->dispatcher->notifyUntil(new sfEvent($e, 'application.throw_exception'));
throw $e;
}
}
This solves the problem.