Commit 4ca0e586 authored by Fabien Potencier's avatar Fabien Potencier

udpated documentation for the previous commits (closes #301)

parent b3fc523b
......@@ -3,6 +3,8 @@ Changelog
This changelog references all backward incompatibilities as we introduce them:
* **2012-05-21**: Changed error() to allow handling specific exceptions.
* **2012-05-20**: Added a way to define settings on a controller collection.
* **2012-05-20**: The Request instance is not available anymore from the
......
......@@ -485,6 +485,14 @@ handle them differently::
return new Response($message, $code);
});
You can restrict an error handler to only handle some Exception classes by
setting a more specific type hint for the Closure argument::
$app->error(function (\LogicException $e, $code) {
// this handler will only \LogicException exceptions
// and exceptions that extends \LogicException
});
If you want to set up logging you can use a separate error handler for that.
Just make sure you register it before the response error handlers, because
once a response is returned, the following handlers are ignored.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment