public function prepareException(MvcEvent $e)
    {
        if ($e->getRequest() instanceof Request) {
            $error = $e->getError();
            if (!empty($error) && !$e->getResult() instanceof Response) {
                switch ($error) {
                    case Application::ERROR_CONTROLLER_NOT_FOUND:
                    case Application::ERROR_CONTROLLER_INVALID:
                    case Application::ERROR_ROUTER_NO_MATCH:
                        // Specifically not handling these
                        return;

                    case Application::ERROR_EXCEPTION:
                    default:
                        /** @var Exception $exception */
                        $exception = $e->getParam('exception');
                        // Filter exceptions that we must except
                        foreach ($this->whoopsConfig['blacklist'] as $except) {
                            if ($exception instanceof $except) {
                                return;
                            }
                        }

                        if ($this->whoopsConfig['handler']['options_type'] === 'prettyPage') {
                            $response = $e->getResponse();
                            if (!$response || $response->getStatusCode() === 200) {
                                header('HTTP/1.0 500 Internal Server Error', true, 500);
                            }
                            ob_clean();
                        }

                        $this->run->handleException($e->getParam('exception'));
                        break;
                }
            }
        }
    }