PHPackages                             tregor/error-handler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. tregor/error-handler

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

tregor/error-handler
====================

Beautiful and informative PHP Error Handler!

1.1.3(5y ago)675MITPHPPHP &gt;=5.4.0

Since Feb 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/tregor/ErrorHandler)[ Packagist](https://packagist.org/packages/tregor/error-handler)[ Docs](https://github.com/tregor/ErrorHandler)[ RSS](/packages/tregor-error-handler/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

Beautiful and informative PHP Error Handler!
============================================

[](#beautiful-and-informative-php-error-handler)

[![Total Downloads](https://camo.githubusercontent.com/f3b92baef40fa41516608c9368ff9175a59fdf1ef8c57c8e28bb177217a0945b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f747265676f722f6572726f722d68616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tregor/error-handler)[![GitHub Version](https://camo.githubusercontent.com/f9479815c40ef98b8c742207ea4b05ad0b771cc926d394a534c9f2f3f73283a0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f747265676f722f4572726f7248616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://github.com/tregor/ErrorHandler)[![Last Commit](https://camo.githubusercontent.com/08cf12ff248559f382d63f8b8f700f84d820b030c0cc841176af2ceac457f2a0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f747265676f722f4572726f7248616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://github.com/tregor/ErrorHandler)[![PHP Req](https://camo.githubusercontent.com/c0e5201dbb9e3bc0058d8c1c286485c4f078c718fb34e1e1954262f038854528/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f747265676f722f6572726f722d68616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tregor/error-handler)[![License](https://camo.githubusercontent.com/79b209b659e3114f35ebe2446242ec2d68385a011ddb8eb046049f1b386bf620/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747265676f722f4572726f7248616e646c65722e7376673f7374796c653d666c61742d737175617265)](LICENSE)

PHP library for handling exceptions and errors! (Now with direct href to StackOverflow 😉 )

> **Debug is never been so cool and easy!😃**
>
> *(C) Bill Gates*

> **Make handlers great again!😎**
>
> *(C) Steve Jobs*

> **I have sex with that library!!!😍**
>
> *(C) Bill Clinton*

> **Okay, let's see what this library can...😏**
>
> *(C) Typical Programmer*

This library turns debugging from a boring and monotonous work into a simple and easy process with a beautiful interface and smart error tracking!

According to the fictional statistics, when using this library, the fix of errors occurs in 87.13% faster compared to without the library!

If you start using this library right now, then we will give you access to the StackOverflow website for 1 year ABSOLUTELY FREE!

We will also give you the certificate of "BaD DeV" if you recommend this library to your friends!

And finally: this is my first public library, which is not made of shit and sticks. Thanks for using!:blush:

---

Navigation
----------

[](#navigation)

- [Requirements](#requirements)
- [Installation](#installation)
- [Available Methods](#available-methods)
- [Quick Start](#quick-start-and-usage)
- [Images](#images)
- [TODO](#todo)
- [Contribute](#contribute)
- [License](#license)
- [Copyright](#copyright)

---

Requirements
------------

[](#requirements)

This library is supported by **PHP versions 5.4** or higher.

Installation
------------

[](#installation)

The preferred way to install this extension is through [Composer](http://getcomposer.org/download/).

To install **PHP ErrorHandler library**, simply:

```
$ composer require tregor/error-handler

```

You can also **clone the complete repository** with Git:

```
$ git clone https://github.com/tregor/ErrorHandler.git

```

Or **install it manually**:

[Download ErrorHandler.php](https://github.com/tregor/ErrorHandler/archive/master.zip):

```
$ wget https://github.com/tregor/ErrorHandler/archive/master.zip

```

Available Methods
-----------------

[](#available-methods)

Available methods in this library:

### - Set renderer template:

[](#--set-renderer-template)

To set custom renderer template, that you can download appart or create yourself, you must provide those code:

```
ErrorHandler::setTemplate(string $templateName);
```

### - Set trace depth:

[](#--set-trace-depth)

By default trace depth is 0, equivalent to infinity. You can set trace steps depth by providing those code:

```
ErrorHandler::setTraceDepth(integer $traceDepth);
```

Quick Start and Usage
---------------------

[](#quick-start-and-usage)

To use this class with **Composer**:

```
require __DIR__ . '/vendor/autoload.php';

new tregor\ErrorHandler\ErrorHandler;
```

Or If you installed it **manually**, use it:

```
require_once __DIR__ . '/ErrorHandler.php';

new tregor\ErrorHandler\ErrorHandler;
```

Images
------

[](#images)

**EXCEPTION Handler:**[![image](img/Exception.png)](img/Exception.png)

**ERROR Handler:**[![image](img/Error.png)](img/Error.png)

**WARNING Handler:**[![image](img/Notice.png)](img/Notice.png)

**NOTICE Handler:**[![image](img/Warning.png)](img/Warning.png)

TODO
----

[](#todo)

- Make some settings.
- Improve documentation.
- Add enviroment variables on debug page.
- Update colors in template.
- Include CLI version of error respond.
- Refactor code.
- Make it better.
- Take a cup of coffee.

Contribute
----------

[](#contribute)

If you would like to help, please take a look at the list of [issues](https://github.com/tregor/ErrorHandler/issues) or the [ToDo](#todo) checklist.

**Pull requests**

- [Fork and clone](https://help.github.com/articles/fork-a-repo).
- Run the **tests**.
- Create a **branch**, **commit**, **push** and send me a [pull request](https://help.github.com/articles/using-pull-requests).

License
-------

[](#license)

This project is licensed under **MIT license**. See the [LICENSE](LICENSE) file for more info.

Copyright
---------

[](#copyright)

By tregor 2019

Please let me know if you have feedback or suggestions.

You can contact me on [Telegram](https://t.me/tregor) or through my [email](mailto:tregor1997@gmail.com).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~274 days

Total

4

Last Release

1836d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f9c79ece6c5db08deb64eb90577aa98570ee03e8e54e5404597b25a20127a2c?d=identicon)[tregor](/maintainers/tregor)

---

Top Contributors

[![tregor](https://avatars.githubusercontent.com/u/4541631?v=4)](https://github.com/tregor "tregor (24 commits)")

---

Tags

phpdebugexceptionerrorthrowableerror-handlererrorhandlerexception handlerthrowexceptionhandler

### Embed Badge

![Health badge](/badges/tregor-error-handler/health.svg)

```
[![Health](https://phpackages.com/badges/tregor-error-handler/health.svg)](https://phpackages.com/packages/tregor-error-handler)
```

###  Alternatives

[filp/whoops

php error handling for cool kids

13.2k402.4M1.4k](/packages/filp-whoops)[recca0120/laravel-tracy

A Laravel Package to integrate Nette Tracy Debugger

388283.0k3](/packages/recca0120-laravel-tracy)[kuria/error

Makes handling and debugging PHP errors suck less

1920.0k2](/packages/kuria-error)[thehocinesaad/laravel-error-ai

This package adds Ask AI button to the error page.

2214.4k](/packages/thehocinesaad-laravel-error-ai)[awesomite/error-dumper

Pretty preview of errors and exceptions

238.2k1](/packages/awesomite-error-dumper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
