PHPackages                             bsadnu/php-exceptions - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bsadnu/php-exceptions

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bsadnu/php-exceptions
=====================

The helpful custom PHP exceptions and exception interfaces

v0.2.2(6y ago)21.6kMITPHPPHP ^7.1

Since Nov 7Pushed 6y ago1 watchersCompare

[ Source](https://github.com/bsadnu/php-exceptions)[ Packagist](https://packagist.org/packages/bsadnu/php-exceptions)[ RSS](/packages/bsadnu-php-exceptions/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

The helpful custom PHP exceptions
=================================

[](#the-helpful-custom-php-exceptions)

[![Latest Stable Version](https://camo.githubusercontent.com/d9a6a64aab3f62f7c68861778cedf62a4aad02e01cfadfda789ec54a12a945eb/68747470733a2f2f706f7365722e707567782e6f72672f627361646e752f7068702d657863657074696f6e732f762f737461626c65)](https://packagist.org/packages/bsadnu/helpers-box)[![Total Downloads](https://camo.githubusercontent.com/af8df19632528c5c576e92fce6be1a0fa8f04641c5f457f427fef29645589937/68747470733a2f2f706f7365722e707567782e6f72672f627361646e752f7068702d657863657074696f6e732f646f776e6c6f616473)](https://packagist.org/packages/bsadnu/helpers-box)[![License](https://camo.githubusercontent.com/83f9cce736b258854e37df824d5300710d31cdc1e5af5b876145c2e553ab5d3d/68747470733a2f2f706f7365722e707567782e6f72672f627361646e752f7068702d657863657074696f6e732f6c6963656e7365)](https://packagist.org/packages/bsadnu/helpers-box)

This lets you catch different-layers-specific exceptions (if needed).

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

[](#installation)

The best way to use this component is through the Composer:

```
composer require bsadnu/php-exceptions
```

Usage
-----

[](#usage)

- You may use exceptions within the standard throwing/catching mechanism or even extend them in any way you want:

```
use Bsadnu\Exception\Base\InvalidArgumentException;

...

try {
    ...
} catch (InvalidArgumentException $exception) {
    ...
}
```

```
use Bsadnu\Exception\Base\TypeError;

...

throw new TypeError($message);
```

- It is really helpful to catch either the base `BaseExceptionInterface` or any other. Therefore, you can control a group of exceptions. Moreover, you may add manually as many specific interfaces as you wish.

More detailed description
-------------------------

[](#more-detailed-description)

All exceptions used in this library implements `\Bsadnu\Exception\Interfaces\BaseExceptionInterface`, and extend one of the SPL extensions. This way, you have several ways of catching specific extension groups:

1. Catch all exceptions: `\Exception`
2. Catch all exceptions thrown by the library: `\Bsadnu\Exception\Interfaces\BaseExceptionInterface`
3. Catch a specific SPL exception: `\LogicException`
4. Catch a specific exception thrown by the library: `\Bsadnu\Exception\Base\LogicException`

Contributing
------------

[](#contributing)

All feedback / bug reports / pull requests are welcome.

License
-------

[](#license)

This code is licensed under the [MIT License](LICENSE).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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 ~105 days

Total

3

Last Release

2536d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c40643785ed729956d17c4c166f04699d00868c6a12590d86db1e179f3c8da4?d=identicon)[bsadnu](/maintainers/bsadnu)

---

Top Contributors

[![bsadnu](https://avatars.githubusercontent.com/u/15787281?v=4)](https://github.com/bsadnu "bsadnu (6 commits)")

---

Tags

custom-exceptionsexceptionexceptionsphpphp7phpexceptionexceptionscustom-exceptions

### Embed Badge

![Health badge](/badges/bsadnu-php-exceptions/health.svg)

```
[![Health](https://phpackages.com/badges/bsadnu-php-exceptions/health.svg)](https://phpackages.com/packages/bsadnu-php-exceptions)
```

###  Alternatives

[phpattempt/phpattempt

Helper function to enforce error-first approach in your code

1710.4k](/packages/phpattempt-phpattempt)

PHPackages © 2026

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