Skip to content

Commit

Permalink
Don't call errorHandler if we don't have one
Browse files Browse the repository at this point in the history
If the errorHandler has been unregistered, then just throw the Exception
again. This allows for completely disabling our error handling by doing:

    unset($app->getContainer()['errorHandler']);
  • Loading branch information
akrabat committed Sep 5, 2015
1 parent a1427aa commit 821511e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Slim/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ public function run($silent = false)
} catch (SlimException $e) {
$response = $e->getResponse();
} catch (Exception $e) {
if (!$this->container->has('errorHandler')) {
throw $e;
}
/** @var callable $errorHandler */
$errorHandler = $this->container->get('errorHandler');
$response = $errorHandler($request, $response, $e);
Expand Down

0 comments on commit 821511e

Please sign in to comment.