变更
This commit is contained in:
@@ -22,9 +22,11 @@ class ExceptionHandlerDispatcher implements ExceptionHandlerInterface
|
|||||||
* @param Throwable $exception
|
* @param Throwable $exception
|
||||||
* @param object $response
|
* @param object $response
|
||||||
* @return ResponseInterface
|
* @return ResponseInterface
|
||||||
|
* @throws
|
||||||
*/
|
*/
|
||||||
public function emit(Throwable $exception, object $response): ResponseInterface
|
public function emit(Throwable $exception, object $response): ResponseInterface
|
||||||
{
|
{
|
||||||
|
error($exception);
|
||||||
$response->withContentType(ContentType::HTML)->withBody(new Stream(jTraceEx($exception, null, true)));
|
$response->withContentType(ContentType::HTML)->withBody(new Stream(jTraceEx($exception, null, true)));
|
||||||
if ($exception->getCode() == 404) {
|
if ($exception->getCode() == 404) {
|
||||||
return $response->withStatus(404);
|
return $response->withStatus(404);
|
||||||
|
|||||||
@@ -86,10 +86,8 @@ class ServerRequest
|
|||||||
|
|
||||||
$PsrResponse = (new HttpRequestHandler($middleware, $dispatcher))->handle($request);
|
$PsrResponse = (new HttpRequestHandler($middleware, $dispatcher))->handle($request);
|
||||||
} catch (\Throwable $throwable) {
|
} catch (\Throwable $throwable) {
|
||||||
error($throwable);
|
|
||||||
$PsrResponse = $this->exception->emit($throwable, di(ConstrictResponse::class));
|
$PsrResponse = $this->exception->emit($throwable, di(ConstrictResponse::class));
|
||||||
} finally {
|
} finally {
|
||||||
var_dump($this->emitter, $PsrResponse, $response);
|
|
||||||
$this->emitter->sender($PsrResponse, $response);
|
$this->emitter->sender($PsrResponse, $response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user