PHPackages                             vudaltsov/exceptionally - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. vudaltsov/exceptionally

Abandoned → [thesis/exceptionally](/?search=thesis%2Fexceptionally)Library[Validation &amp; Sanitization](/categories/validation)

vudaltsov/exceptionally
=======================

Converts errors into exceptions easily

0.1.0(6y ago)72MITPHPPHP ^7.1CI passing

Since Aug 3Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/vudaltsov/exceptionally)[ Packagist](https://packagist.org/packages/vudaltsov/exceptionally)[ RSS](/packages/vudaltsov-exceptionally/feed)WikiDiscussions 0.3.x Synced 4d ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Thesis Exceptionally
====================

[](#thesis-exceptionally)

A tiny PHP library that converts errors to exceptions.

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

[](#installation)

```
composer require thesis/exceptionally
```

Requires PHP 8.3+.

Usage
-----

[](#usage)

```
use function Thesis\exceptionally;

// Converts PHP errors to ErrorException
$content = exceptionally(static fn() => file_get_contents('/path/to/file'));
```

Many PHP functions trigger errors instead of throwing exceptions. This makes error handling inconsistent and cumbersome. `exceptionally()` wraps a callable and converts any triggered error into a native [ErrorException](https://php.net/manual/class.errorexception.php).

### Error suppression operator

[](#error-suppression-operator)

Errors suppressed with `@` are not converted to exceptions:

```
// Does not throw — the error is suppressed
$content = exceptionally(static fn() => @file_get_contents('/path/to/file'));
```

### Filtering by error level

[](#filtering-by-error-level)

By default, all levels except `E_DEPRECATED` and `E_USER_DEPRECATED` are converted. Deprecations typically come from third-party libraries and should not interrupt execution.

You can specify which levels to convert:

```
// Convert notices
$result = exceptionally($function, E_USER_NOTICE);

// Convert warnings and notices
$result = exceptionally($function, E_USER_WARNING | E_USER_NOTICE);

// Convert all, including deprecations
$result = exceptionally($function, E_ALL);
```

License
-------

[](#license)

MIT

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance60

Regular maintenance activity

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Total

2

Last Release

51d ago

PHP version history (2 changes)0.1.0PHP ^7.1

0.2.x-devPHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2552865?v=4)[Valentin Udaltsov](/maintainers/vudaltsov)[@vudaltsov](https://github.com/vudaltsov)

---

Top Contributors

[![vudaltsov](https://avatars.githubusercontent.com/u/2552865?v=4)](https://github.com/vudaltsov "vudaltsov (38 commits)")

###  Code Quality

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vudaltsov-exceptionally/health.svg)

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

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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