Prooph\ServiceBus\MessageBus::handleException PHP Method

handleException() protected method

protected handleException ( Prooph\Common\Event\ActionEvent $actionEvent, Exception $ex )
$actionEvent Prooph\Common\Event\ActionEvent
$ex Exception
    protected function handleException(ActionEvent $actionEvent, \Exception $ex)
    {
        $failedPhase = $actionEvent->getName();
        $actionEvent->setParam(self::EVENT_PARAM_EXCEPTION, $ex);
        $this->triggerError($actionEvent);
        $this->triggerFinalize($actionEvent);
        //Check if a listener has removed the exception to indicate that it was able to handle it
        if ($ex = $actionEvent->getParam(self::EVENT_PARAM_EXCEPTION)) {
            $actionEvent->setName($failedPhase);
            throw MessageDispatchException::failed($actionEvent, $ex);
        }
    }