public function onException(GetResponseForExceptionEvent $event) {
    $exception = $event->getException();
    if (!($exception instanceof RouteException) || PHP_SAPI === 'cli') {
      return;
    }

    $handler = \Drupal::service('acm_exception.route_exception_handler');
    $redirect = $handler->getRedirect($exception);
    $event->setResponse(RedirectResponse::create($redirect, 302));
  }