Skip to content

Commit

Permalink
Merge pull request #57 from dapr/fix/no-output
Browse files Browse the repository at this point in the history
The hunt for the empty response
  • Loading branch information
withinboredom authored Feb 16, 2021
2 parents 8c4bcd0 + 3e18516 commit d968601
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
use Psr\Http\Message\StreamInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
use Throwable;

/**
* Class App
Expand Down Expand Up @@ -199,7 +200,7 @@ public function start(?ServerRequestInterface $request = null): void
} catch (NotFound $exception) {
$response = $this->psr17Factory->createResponse(404)->withAddedHeader('Content-Type', 'application/json');
$this->logger->info('Route threw a NotFound exception, returning 404.', ['exception' => $exception]);
} catch (Exception $exception) {
} catch (Throwable $exception) {
$response = $this->psr17Factory->createResponse(500)->withBody(
$this->psr17Factory->createStream($this->serializer->as_json($exception))
)->withHeader('Content-Type', 'application/json');
Expand Down

0 comments on commit d968601

Please sign in to comment.