public function onKernelException(GetResponseForExceptionEvent $event)
{
$exception = $event->getException();
if ($exception instanceof HasRelationException) {
$this->onHasRelationException($event);
}
if ($exception instanceof MethodNotAllowedHttpException) {
$this->onMethodNotAllowedHttpException($event);
}
}