Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/duncan3dc/exceptions
A small PHP library to catch exceptions and throw them all together later
https://github.com/duncan3dc/exceptions
catch exception php try
Last synced: 4 days ago
JSON representation
A small PHP library to catch exceptions and throw them all together later
- Host: GitHub
- URL: https://github.com/duncan3dc/exceptions
- Owner: duncan3dc
- License: apache-2.0
- Created: 2016-07-02T14:52:18.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2024-02-23T17:56:33.000Z (9 months ago)
- Last Synced: 2024-03-23T23:02:27.269Z (8 months ago)
- Topics: catch, exception, php, try
- Language: PHP
- Size: 738 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# exceptions
A small PHP library to catch exceptions and throw them all together later.Full documentation is available at http://duncan3dc.github.io/exceptions/
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://poser.pugx.org/duncan3dc/exceptions/version.svg)](https://packagist.org/packages/duncan3dc/exceptions)
[![build](https://travis-ci.org/duncan3dc/exceptions.svg?branch=master)](https://travis-ci.org/duncan3dc/exceptions)
[![coverage](https://codecov.io/gh/duncan3dc/exceptions/graph/badge.svg)](https://codecov.io/gh/duncan3dc/exceptions)## Installation
The recommended method of installing this library is via [Composer](//getcomposer.org/).
Run the following command from your project root:
```bash
$ composer require duncan3dc/exceptions
```## Usage
```php
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 http://duncan3dc.github.io/exceptions/_
## Changelog
A [Changelog](CHANGELOG.md) has been available since the beginning of time## 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
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)