PHPackages                             fp/universal-error-catcher - 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. fp/universal-error-catcher

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

fp/universal-error-catcher
==========================

Easy way to catch and handle all php errors and exceptions.

1.0.2(13y ago)2116.4k8[5 issues](https://github.com/formapro/UniversalErrorCatcher/issues)[1 PRs](https://github.com/formapro/UniversalErrorCatcher/pulls)MITPHPPHP &gt;=5.2.7

Since Dec 30Pushed 13y ago7 watchersCompare

[ Source](https://github.com/formapro/UniversalErrorCatcher)[ Packagist](https://packagist.org/packages/fp/universal-error-catcher)[ Docs](https://github.com/formapro/UniversalErrorCatcher)[ RSS](/packages/fp-universal-error-catcher/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

\#Universal error catcher [![Build Status](https://camo.githubusercontent.com/0121a61a9889150fa4912b0c2b6b226bcd824df4e4e4b17f094c7a9f7175ca1d/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f666f726d6170726f2f556e6976657273616c4572726f72436174636865722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/formapro/UniversalErrorCatcher)

Overview
--------

[](#overview)

It wraps errors and exception handling logic. Any exceptions or errors (even parse and fatal ones) are handled in the same way.

The lib also provides two custom exceptions:

- `FatalErrorException` - fatal errors i.e. `E_ERROR`, `E_PARSE`, `E_CORE_ERROR`, `E_COMPILE_ERROR`
- `SuppressedErrorException` - recoverable errors which comes from the code under `@`

It is completely covered with phpunit tests.

Instalation
-----------

[](#instalation)

[Composer](http://getcomposer.org/) is a prefered way to install it.

```
php composer.phar require fp/universal-error-catcher
```

When you are asked for a version constraint, type \* and hit enter.

Quick tour
----------

[](#quick-tour)

The example shows the simplest way of sanding an email on each error.

```
