PHPackages                             duncan3dc/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. duncan3dc/exceptions

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

duncan3dc/exceptions
====================

A small library to catch exceptions and throw them all at the end

1.2.0(2y ago)024Apache-2.0PHPPHP ^7.3 || ^8.0CI failing

Since Aug 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/duncan3dc/exceptions)[ Packagist](https://packagist.org/packages/duncan3dc/exceptions)[ Docs](https://github.com/duncan3dc/exceptions)[ RSS](/packages/duncan3dc-exceptions/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (7)Versions (9)Used By (0)

exceptions
==========

[](#exceptions)

A small PHP library to catch exceptions and throw them all together later.

Full documentation is available at
PHPDoc API documentation is also available at [http://duncan3dc.github.io/exceptions/api/](http://duncan3dc.github.io/exceptions/api/namespaces/duncan3dc.Exceptions.html)

[![release](https://camo.githubusercontent.com/a5ba1981a86fc4de05c47838f3c98aa5dcae218dc4289d81e5b36dbde11f440f/68747470733a2f2f706f7365722e707567782e6f72672f64756e63616e3364632f657863657074696f6e732f76657273696f6e2e737667)](https://packagist.org/packages/duncan3dc/exceptions)[![build](https://camo.githubusercontent.com/ea31ef2d0e158f2e8d8353372d3bab4089fccb1215b4ed0044cba93eea9935a7/68747470733a2f2f7472617669732d63692e6f72672f64756e63616e3364632f657863657074696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/duncan3dc/exceptions)[![coverage](https://camo.githubusercontent.com/a60281b12978e9b5e90a8388c46048869a70f88c121594961e7a7d44a4d1068c/68747470733a2f2f636f6465636f762e696f2f67682f64756e63616e3364632f657863657074696f6e732f67726170682f62616467652e737667)](https://codecov.io/gh/duncan3dc/exceptions)

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

[](#installation)

The recommended method of installing this library is via [Composer](//getcomposer.org/).

Run the following command from your project root:

```
$ composer require duncan3dc/exceptions
```

Usage
-----

[](#usage)

```
use duncan3dc\Exceptions\Catcher;

require __DIR__ . "/vendor/autoload.php";

$catcher = new Catcher;

$catcher->try(function () {
    throw new \Exception("Whoops1!");
});

$catcher->try(function () {
    throw new \Exception("Whoops2!");
});

$catcher->try(function () {
    echo "ok\n";
});

$catcher->throw();
```

*Read more at *

Changelog
---------

[](#changelog)

A [Changelog](CHANGELOG.md) has been available since the beginning of time

Where to get help
-----------------

[](#where-to-get-help)

Found a bug? Got a question? Just not sure how something works?
Please [create an issue](//github.com/duncan3dc/exceptions/issues) and I'll do my best to help out.
Alternatively you can catch me on [Twitter](https://twitter.com/duncan3dc)

duncan3dc/exceptions for enterprise
-----------------------------------

[](#duncan3dcexceptions-for-enterprise)

Available as part of the Tidelift Subscription

The maintainers of duncan3dc/exceptions and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-duncan3dc-exceptions?utm_source=packagist-duncan3dc-exceptions&utm_medium=referral&utm_campaign=readme)

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity73

Established project with proven stability

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

Total

5

Last Release

858d ago

Major Versions

0.2.0 → 1.0.02017-05-29

PHP version history (3 changes)0.1.0PHP &gt;=7.0.0

1.0.0PHP ^7.0

1.2.0PHP ^7.3 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/11dc66042513f11d1c99b1e6763f25dca84a3ff31cdbea3972b9b804a3d3d5e9?d=identicon)[duncan3dc](/maintainers/duncan3dc)

---

Top Contributors

[![duncan3dc](https://avatars.githubusercontent.com/u/546811?v=4)](https://github.com/duncan3dc "duncan3dc (45 commits)")

---

Tags

catchexceptionphptryexceptionsdelaytrycatch

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[kdyby/strict-objects

Simple trait to make your class strict, when calling or accessing undefined member (property or method).

311.7M18](/packages/kdyby-strict-objects)[orisai/exceptions

Exceptions designed for static analysis and easy usage

22179.1k30](/packages/orisai-exceptions)[dstuecken/php7ify

php7ify is a project that brings new php7 classes and exceptions to php 5.x.

11158.4k1](/packages/dstuecken-php7ify)[chippyash/monad

Functional programming Monad support

2728.4k8](/packages/chippyash-monad)

PHPackages © 2026

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