Skip to content
Snippets Groups Projects
Commit 852b4fc2 authored by Haralan Dobrev's avatar Haralan Dobrev Committed by Fabien Potencier
Browse files

Add note about ExceptionHandler in CLI

parent bc50a7e6
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment