silencenjoyer/silence-error-handling

Silence error handling system.

0.0.3 2025-07-21 17:07 UTC

This package is auto-updated.

Last update: 2025-07-22 22:32:06 UTC


README

Latest Stable Version PHP Version Require License

The package is designed for centralised processing of errors and exceptions. It provides a readable view of errors.

Base Template Example

This package is part of the monorepository silencenjoyer/silence, but can be used independently.

โš™๏ธ Installation

composer require silencenjoyer/silence-error-handling

๐Ÿš€ Quick start

<?php

use Silence\ErrorHandler\ErrorHandler;
use Silence\ErrorHandler\Renderers\HtmlRenderer;

$errorHandler = new ErrorHandler(new HtmlRenderer());
$errorHandler->register();

๐Ÿงฑ Features:

  • Interception of unhandled exceptions, compatible with PSR-15 middleware.
  • Memory reserve to Avoid "Out of Memory" lockups
  • Dynamic memory reserve adjustment
  • Graceful fallback - When in non-debug mode, hides internal details.
  • Detailed trace - When debug mode is enabled, provides full details.
  • Shutdown error capture
  • Unified rendering

๐Ÿงช Testing

php vendor/bin/phpunit

๐Ÿงฉ Use in the composition of Silence

The package is used to intercept errors in the Silence application.
If you are writing your own package, you can connect silencenjoyer/silence-error-handling for the same reason.

๐Ÿ“„ License

This package is distributed under the MIT licence. For more details, see LICENSE.