module/Core/Module.php
public function onDispatchError( MvcEvent $event )
    {
        /* @var $exception \Exception  */
        $exception = $event->getParam( 'exception' );

        if ( $exception && $exception instanceof Exception )
        {
            $this->exceptionHandler( $exception, false );
        }

        if ( $this->response )
        {
            $event->stopPropagation();
            return $this->response;
        }
    }
public function onDispatchError( MvcEvent $event )
    {
        /* @var $exception \Exception  */
        $exception = $event->getParam( 'exception' );

        if ( $exception && $exception instanceof Exception )
        {
            $this->exceptionHandler( $exception, false );
        }

        if ( $this->response )
        {
            $event->stopPropagation();
            return $this->response;
        }
    }
public function onDispatchError ( MvcEvent $ event ) { /* @var $exception \Exception  */ $ exception = $ event -> getParam ( 'exception' ) ; if ( $ exception && $ exception instanceof Exception ) { $ this -> exceptionHandler ( $ exception , false ) ; } if ( $ this -> response ) { $ event -> stopPropagation ( ) ; return $ this -> response ; } }
Listen to the dispatch.error event

@param \Zend\Mvc\MvcEvent $event
Listen to the dispatch . error event