Exception handle in zend framework in module.php -


i developing zf3 app. need catch error-exception on module.php. go through many of existing answer, seems not solve problem.

is there way catch exceptions on module.php.

thanks

in zend framework3, can eventmanager, on bootstrap, in module.php.

  1. event dispatch.error, fired on exception on dispatch of controller, action
  2. event render.error, fired on exception in rending of view(html).
public function onbootstrap(mvcevent $e)     {         $eventmanager        = $e->getapplication()->geteventmanager();         //error on dispatch         $eventmanager->attach('dispatch.error', function (mvcevent $e) {             if ($e->getparam('exception')) {                 $exception = $e->getparam('exception'); // exception object                 var_dump($exception->getmessage());exit;             }         }, 100);         // error on render         $eventmanager->attach('render.error', function (mvcevent $e) {             if ($e->getparam('exception')) {                 $exception = $e->getparam('exception');             }         }, 100);     } 

Comments