PHPackages                             fivepercent/error - 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. fivepercent/error

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

fivepercent/error
=================

Control error codes with many systems

v1.0(10y ago)01.8k11MITPHPPHP &gt;=5.4

Since Jun 4Pushed 10y ago6 watchersCompare

[ Source](https://github.com/InnoGr/FivePercent-Error)[ Packagist](https://packagist.org/packages/fivepercent/error)[ RSS](/packages/fivepercent-error/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (1)

Error
=====

[](#error)

With this package, you can control error codes and exceptions in system with many sub systems.

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

[](#installation)

Add **FivePercent/Error** in your composer.json:

```
{
    "require": {
        "fivepercent/error": "~1.0"
    }
}
```

Now tell composer to download the library by running the command:

```
$ php composer.phar update fivepercent/error
```

Basic usage
-----------

[](#basic-usage)

For collect all error codes, you must create a error factory in you sub system:

```
use FivePercent\Component\Error\ErrorFactoryInterface;

final class MySystemError implements ErrorFactoryInterface
{
    const ERROR_1 = 1;
    const ERROR_2 = 2;

    public function getErrors()
    {
        return [
            self::ERROR_1 => 'Error #1',
            self::ERROR_2 => 'Error #2'
        ];
    }

    public function getExceptions()
    {
        return [];
    }

    public function getReservedDiapason()
    {
        return [1, 5];
    }
}
```

And create error system (Storage), and add this factory to storage:

```
use FivePercent\Component\Error\Errors;

$errors = new Errors();
$errors->addFactory(new MySystemError());
```

After, you can:

1. Get reserved diapasons for each system```
    $errors->getReservedCodes();
    ```
2. Get all errors for system```
    $errors->getErrors();
    ```
3. Get all exceptions```
    $exceptions = $errors->getExceptions();
    ```
4. Check, if has exception in errors storage```
    $exception = new \Exception();
    $errors->hasException($exception);
    ```
5. Get error code for exception```
    $exception = new \Exception();
    $code = $errors->getExceptionCode($exception);
    ```
6. Check reserved codes```
    $errors->checkReservedCodes();
    ```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community13

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

Unknown

Total

1

Last Release

4001d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/16cc6c4d32a2c7f1cd584f31db9428341ad57682521f0f6e607cfe19f1f9157d?d=identicon)[inno-group](/maintainers/inno-group)

---

Top Contributors

[![ZhukV](https://avatars.githubusercontent.com/u/2256109?v=4)](https://github.com/ZhukV "ZhukV (1 commits)")

---

Tags

errorerror codeserror list

### Embed Badge

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

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

###  Alternatives

[rollbar/rollbar-laravel

Rollbar error monitoring integration for Laravel projects

14110.4M7](/packages/rollbar-rollbar-laravel)[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M24](/packages/analog-analog)[jenssegers/rollbar

Rollbar error monitoring integration for Laravel projects

3301.1M2](/packages/jenssegers-rollbar)[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1851.5M3](/packages/justbetter-magento2-sentry)[larabug/larabug

Laravel 6.x/7.x/8.x/9.x/10.x/11.x/12.x/13.x bug notifier

299549.3k1](/packages/larabug-larabug)[saasscaleup/laravel-log-alarm

Laravel log Alarm help you to set up alarm when errors occur in your system and send you a notification via Slack and email

27025.0k](/packages/saasscaleup-laravel-log-alarm)

PHPackages © 2026

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