Skip to content

Commit

Permalink
Pretty exceptions only in debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberts authored and = committed Jul 17, 2013
1 parent bab9b63 commit c98c45e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Slim/Slim.php
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,10 @@ public function run()
set_error_handler(array('\Slim\Slim', 'handleErrors'));

//Apply final outer middleware layers
$this->add(new \Slim\Middleware\PrettyExceptions());
if($this->config('debug')){
//Apply pretty exceptions only in debug to avoid accidental information leakage in production
$this->add(new \Slim\Middleware\PrettyExceptions());
}

//Invoke middleware and application stack
$this->middleware[0]->call();
Expand Down

0 comments on commit c98c45e

Please sign in to comment.