['onCoreException', 1] ]; } /** * @param ExceptionEvent $event */ public function onCoreException(ExceptionEvent $event) { $throwable = $event->getThrowable(); if ($throwable instanceof NotValidMaxPerPageException || $throwable instanceof OutOfRangeCurrentPageException) { $notFoundHttpException = new NotFoundHttpException($throwable->getMessage(), $throwable, $throwable->getCode()); $event->setThrowable($notFoundHttpException); } } }