diff --git a/src/Alterway/Bundle/RestProblemBundle/EventListener/ExceptionListener.php b/src/Alterway/Bundle/RestProblemBundle/EventListener/ExceptionListener.php index fb12c2a..9d0dd0e 100644 --- a/src/Alterway/Bundle/RestProblemBundle/EventListener/ExceptionListener.php +++ b/src/Alterway/Bundle/RestProblemBundle/EventListener/ExceptionListener.php @@ -35,7 +35,7 @@ public function onKernelException(ExceptionEvent $event) !$exception instanceof \LogicException && !$exception instanceof HttpExceptionInterface && !$exception instanceof Assert\InvalidArgumentException && - !$exception instanceof Doctrine\DBAL\Exception\UniqueConstraintViolationException + !$exception instanceof UniqueConstraintViolationException ) { newrelic_notice_error($exception->getMessage(), $exception); newrelic_add_custom_parameter('file', $exception->getFile()); diff --git a/src/Alterway/Bundle/RestProblemBundle/Problem/Exception.php b/src/Alterway/Bundle/RestProblemBundle/Problem/Exception.php index fa1947b..04db31a 100644 --- a/src/Alterway/Bundle/RestProblemBundle/Problem/Exception.php +++ b/src/Alterway/Bundle/RestProblemBundle/Problem/Exception.php @@ -2,6 +2,7 @@ namespace Alterway\Bundle\RestProblemBundle\Problem; +use Doctrine\DBAL\Exception\UniqueConstraintViolationException; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; use Symfony\Component\HttpFoundation\Response; @@ -19,7 +20,7 @@ public function __construct(\Throwable $exception, bool $isVerbose = false) case $exception instanceof HttpExceptionInterface; $this->httpStatus = $exception->getStatusCode(); break; - case $exception instanceof Doctrine\DBAL\Exception\UniqueConstraintViolationException; + case $exception instanceof UniqueConstraintViolationException; $this->httpStatus = Response::HTTP_CONFLICT; break; case $exception instanceof \LogicException: