PHPackages                             geoffroy-aubry/errorhandler - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. geoffroy-aubry/errorhandler

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

geoffroy-aubry/errorhandler
===========================

Error and exception handler

v1.3.1(11y ago)14.0k2LGPL-3.0+JavaScriptPHP &gt;=5.3.3

Since Apr 1Pushed 11y ago1 watchersCompare

[ Source](https://github.com/geoffroy-aubry/ErrorHandler)[ Packagist](https://packagist.org/packages/geoffroy-aubry/errorhandler)[ RSS](/packages/geoffroy-aubry-errorhandler/feed)WikiDiscussions stable Synced 4w ago

READMEChangelogDependencies (7)Versions (13)Used By (2)

ErrorHandler
============

[](#errorhandler)

[![Latest stable version](https://camo.githubusercontent.com/f5d3d7ecaa407668af1bf4d87f3e509891f40cad124ebb5262e23f339bd77909/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67656f6666726f792d61756272792f4572726f7248616e646c65722e737667 "Latest stable version")](https://packagist.org/packages/geoffroy-aubry/ErrorHandler)[![Build Status](https://camo.githubusercontent.com/7ef90c7048932cc9d6782cf894bacf7739a82d991c4d94f2bfe681ff5dfc8df5/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f67656f6666726f792d61756272792f4572726f7248616e646c65722e706e673f6272616e63683d737461626c65)](http://travis-ci.org/geoffroy-aubry/ErrorHandler)[![Coverage Status](https://camo.githubusercontent.com/b0f07df6fd94b548f7c91e720cd11517301efcf71797efd0d46d80422ac21b8b/687474703a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f67656f6666726f792d61756272792f4572726f7248616e646c65722f737461626c652e737667)](https://coveralls.io/r/geoffroy-aubry/ErrorHandler)[![Dependency Status](https://camo.githubusercontent.com/8320617c53719ff104c6e69cecbb8a0849218affdab9fd0912360de3f6e4a9c6/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3533353465313930666530643037316330353030313163312f62616467652e706e67)](https://www.versioneye.com/user/projects/5354e190fe0d071c050011c1)

Simple error and exception handler:

- converts error to an `ErrorException` instance according to error reporting level
- when running the `PHP CLI`, reports errors/exceptions to `STDERR` (even fatal error) and uses exception code as exit status
- allows to deactivate `@` operator
- catches fatal error
- accepts callback to be executed at the end of the internal shutdown function
- accepts callback to display an apology when errors are hidden
- allows to ignore errors on some paths, useful with old libraries and deprecated code…

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

[](#installation)

1. Class autoloading and dependencies are managed by [Composer](http://getcomposer.org/)so install it following the instructions on [Composer: Installation - \*nix](http://getcomposer.org/doc/00-intro.md#installation-nix)or just run the following command:

    ```
    $ curl -sS https://getcomposer.org/installer | php
    ```
2. Add dependency to `GAubry\ErrorHandler` into require section of your `composer.json`:

    ```
    {
        "require": {
            "geoffroy-aubry/errorhandler": "1.*"
        }
    }
    ```

    and run `php composer.phar install` from the terminal into the root folder of your project.
3. Include Composer's autoloader:

    ```
