eZ\Bundle\EzPublishCoreBundle\EventListener\ExceptionListener::getTranslatedMessage PHP Method

getTranslatedMessage() private method

Translates the exception message if it is translatable.
private getTranslatedMessage ( Exception $exception ) : string
$exception Exception
return string
    private function getTranslatedMessage(Exception $exception)
    {
        $message = $exception->getMessage();
        if ($exception instanceof Translatable) {
            $message = $this->translator->trans($exception->getMessageTemplate(), $exception->getParameters(), 'repository_exceptions');
        }
        return $message;
    }