Skip to content

Commit 61e760a

Browse files
mathieudzandig
authored andcommitted
Relay handler errors to worker (#131)
1 parent a607582 commit 61e760a

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

Bridges/HttpKernel.php

+4-14
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,12 @@ public function handle(ServerRequestInterface $request)
8181
// headers_sent() returns true if any unbuffered output reaches cgi stdout.
8282
ob_start();
8383

84-
try {
85-
if ($this->bootstrap instanceof HooksInterface) {
86-
$this->bootstrap->preHandle($this->application);
87-
}
88-
89-
$syResponse = $this->application->handle($syRequest);
90-
} catch (\Exception $exception) {
91-
// internal server error
92-
error_log((string)$exception);
93-
$response = new Psr7\Response(500, ['Content-type' => 'text/plain'], 'Unexpected error');
94-
95-
// end buffering if we need to throw
96-
@ob_end_clean();
97-
return $response;
84+
if ($this->bootstrap instanceof HooksInterface) {
85+
$this->bootstrap->preHandle($this->application);
9886
}
9987

88+
$syResponse = $this->application->handle($syRequest);
89+
10090
$out = ob_get_clean();
10191
$response = $this->mapResponse($syResponse, $out);
10292

0 commit comments

Comments
 (0)