diff --git a/src/Base/ExceptionHandlerDispatcher.php b/src/Base/ExceptionHandlerDispatcher.php index be0ad9a..aee8e22 100644 --- a/src/Base/ExceptionHandlerDispatcher.php +++ b/src/Base/ExceptionHandlerDispatcher.php @@ -22,9 +22,11 @@ class ExceptionHandlerDispatcher implements ExceptionHandlerInterface * @param Throwable $exception * @param object $response * @return ResponseInterface + * @throws */ public function emit(Throwable $exception, object $response): ResponseInterface { + error($exception); $response->withContentType(ContentType::HTML)->withBody(new Stream(jTraceEx($exception, null, true))); if ($exception->getCode() == 404) { return $response->withStatus(404); diff --git a/src/ServerRequest.php b/src/ServerRequest.php index 17a9336..32dcac3 100644 --- a/src/ServerRequest.php +++ b/src/ServerRequest.php @@ -86,10 +86,8 @@ class ServerRequest $PsrResponse = (new HttpRequestHandler($middleware, $dispatcher))->handle($request); } catch (\Throwable $throwable) { - error($throwable); $PsrResponse = $this->exception->emit($throwable, di(ConstrictResponse::class)); } finally { - var_dump($this->emitter, $PsrResponse, $response); $this->emitter->sender($PsrResponse, $response); } }