This commit is contained in:
freek 2018-11-26 23:04:20 +01:00
parent 3dfaa6901c
commit 94fbcf6264
1 changed files with 16 additions and 14 deletions

View File

@ -60,7 +60,10 @@ abstract class EchoController implements HttpServerInterface
function onError(ConnectionInterface $connection, Exception $exception) function onError(ConnectionInterface $connection, Exception $exception)
{ {
if ($exception instanceof HttpException) { if (! $exception instanceof HttpException) {
return;
}
$response = new Response($exception->getStatusCode(), [ $response = new Response($exception->getStatusCode(), [
'Content-Type' => 'application/json' 'Content-Type' => 'application/json'
], json_encode([ ], json_encode([
@ -70,7 +73,6 @@ abstract class EchoController implements HttpServerInterface
$connection->send(Psr\str($response)); $connection->send(Psr\str($response));
$connection->close(); $connection->close();
} }
}
public function ensureValidAppId(string $appId) public function ensureValidAppId(string $appId)
{ {