ErrorHandler Component ====================== The ErrorHandler component provides tools to manage errors and ease debugging PHP code. Getting Started --------------- ``` $ composer require symfony/error-handler ``` ```php use Symfony\Component\ErrorHandler\Debug; use Symfony\Component\ErrorHandler\ErrorHandler; use Symfony\Component\ErrorHandler\DebugClassLoader; Debug::enable(); // or enable only one feature //ErrorHandler::register(); //DebugClassLoader::enable(); // If you want a custom generic template when debug is not enabled // HtmlErrorRenderer::setTemplate('/path/to/custom/error.html.php'); $data = ErrorHandler::call(static function () use ($filename, $datetimeFormat) { // if any code executed inside this anonymous function fails, a PHP exception // will be thrown, even if the code uses the '@' PHP silence operator $data = json_decode(file_get_contents($filename), true); $data['read_at'] = date($datetimeFormat); file_put_contents($filename, json_encode($data)); return $data; }); ``` Resources --------- * [Contributing](https://symfony.com/doc/current/contributing/index.html) * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony)
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Error | Folder | 0755 |
|
|
ErrorEnhancer | Folder | 0755 |
|
|
ErrorRenderer | Folder | 0755 |
|
|
Exception | Folder | 0755 |
|
|
Internal | Folder | 0755 |
|
|
Resources | Folder | 0755 |
|
|
BufferingLogger.php | File | 1.99 KB | 0644 |
|
CHANGELOG.md | File | 774 B | 0644 |
|
Debug.php | File | 1.08 KB | 0644 |
|
DebugClassLoader.php | File | 47.96 KB | 0644 |
|
ErrorHandler.php | File | 26.33 KB | 0644 |
|
LICENSE | File | 1.04 KB | 0644 |
|
README.md | File | 1.31 KB | 0644 |
|
ThrowableUtils.php | File | 865 B | 0644 |
|
composer.json | File | 1015 B | 0644 |
|