Commit 852b4fc2 authored by Haralan Dobrev's avatar Haralan Dobrev Committed by Fabien Potencier

Add note about ExceptionHandler in CLI

parent bc50a7e6
......@@ -36,3 +36,15 @@ the ``$debug`` argument::
use Symfony\Component\Debug\ExceptionHandler;
ExceptionHandler::register(false);
.. note::
Important caveat when using Silex on a command-line interface:
The ``ExceptionHandler`` should not be enabled as it would convert an error
to HTML output and return a non-zero exit code::
use Symfony\Component\Debug\ExceptionHandler;
if (!in_array(PHP_SAPI, ['cli', 'phpdbg'])) {
ExceptionHandler::register();
}
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