public function handle(Exception $exception)
{
foreach ($this->handlers as $hint => $handler) {
if (!$exception instanceof $hint) {
continue;
}
if ($response = $handler($exception)) {
if (!$response instanceof BaseResponse) {
$response = new Response($response, $this->getExceptionStatusCode($exception));
}
return $response;
}
}
return $this->genericResponse($exception);
}