变更
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user