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

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

seotils/deferred-exceptions
===========================

The trait allows you to choose: to throw an exception now, later or simply handle errors. Also it accumulate exceptions of all classes wich use this trait.

0.3.1(9y ago)3703GPL-3.0PHP &gt;=5.6.0

Since Jun 23Compare

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

READMEChangelogDependenciesVersions (10)Used By (3)

DeferredExceptions
==================

[](#deferredexceptions)

Introduction
------------

[](#introduction)

DeferredExceptions trait provides a clean, fluent possibility to choose: to throw an exception now, later or simply handle errors. Also it accumulate exceptions of all classes that use this trait.

Description
-----------

[](#description)

Sometimes you need to call different functions in sequence and be able to see what exceptions they throw.

Usually if one function throws one exception, you cannot see what exceptions the other functions would have thrown.

This package provides a trait that allows you to queue multiple exceptions thrown by classes that use the trait. This way you can have access to the whole list of thrown exceptions throw the last or all exceptions that happened.

License
-------

[](#license)

DeferredExceptions is open-sourced software licensed under the \[GPL-3.0\] ().

Install
-------

[](#install)

```
composer require seotils/deferred-exceptions
composer selfupdate
composer update
```

Usage
-----

[](#usage)

Let's say we have a problem with the class code. Transform it as follows:

```
