slick/error-handler

PHP Error Handler module that captures and displays all throwable errors in a given format, making debugging easier and more efficient

v0.4.0 2024-08-24 18:02 UTC

This package is auto-updated.

Last update: 2024-09-11 00:02:50 UTC


README

Latest Version on Packagist Software License Build Status Quality Score Total Downloads

This custom PHP Error Handler is designed to intercept and manage all throwable errors, including exceptions and fatal errors providing a robust and user-friendly error handling experience. The module captures detailed error information and presents it within a well-structured template, offering clear and concise feedback to developers. This enhances debugging by displaying the error type, message, file, line number, and a stack trace, all within an aesthetically pleasing and easily navigable interface. This approach ensures a smooth user experience while simplifying error diagnosis and resolution for developers.

This package is compliant with PSR-2 code standards and PSR-4 autoload standards. It also applies the semantic version 2.0.0 specification.

Install

Via Composer

$ composer require slick/error-handler

Usage

In you startup script add the following:

// index.php
<?php

use Slick\ErrorHandler\Runner;
use Slick\ErrorHandler\Util\SystemFacade;

require_once 'vendor/autoload.php';

$runner = new Runner(new SystemFacade());
$runner->pushHandler(fn (Throwable $throwable) => echo $throwable->getMessage())
       ->register();

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email slick.framework@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.