PHPackages                             eboreum/exceptional - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. eboreum/exceptional

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

eboreum/exceptional
===================

Create and format PHP exceptions easily. Automatically unravel method arguments. Ensure that sensitive strings like passwords, tokens, PHPSESSID, etc. are being masked and thus will instead appear as e.g. "\*\*\*\*\*\*" in the resulting text.

2.0.0(1y ago)06.8k↓34.8%[1 issues](https://github.com/eboreum/exceptional/issues)2MITPHPPHP ^8.3CI passing

Since Apr 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/eboreum/exceptional)[ Packagist](https://packagist.org/packages/eboreum/exceptional)[ RSS](/packages/eboreum-exceptional/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (4)Used By (2)

Eboreum/Exceptional: Create and format PHP exceptions easily
============================================================

[](#eboreumexceptional-create-and-format-php-exceptions-easily)

[![license](https://camo.githubusercontent.com/d25c96d56aa0833e911095f522b39a5536f1cfc6d221db78e4eb2b1e14b1bfc8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f65626f7265756d2f657863657074696f6e616c3f6c6162656c3d6c6963656e7365)](https://camo.githubusercontent.com/d25c96d56aa0833e911095f522b39a5536f1cfc6d221db78e4eb2b1e14b1bfc8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f65626f7265756d2f657863657074696f6e616c3f6c6162656c3d6c6963656e7365)[![build](https://github.com/eboreum/exceptional/workflows/build/badge.svg?branch=main)](https://github.com/eboreum/exceptional/workflows/build/badge.svg?branch=main)[![Code Coverage](https://camo.githubusercontent.com/8741dba28e8ad2e59d06302f66659efcb8be0c9c046713b77b9c55019ea425e0/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f676973742e67697468756275736572636f6e74656e742e636f6d2f6b61666f736f2f61366534666664343038396535653661313365333037633730373834396562372f7261772f746573742d636f7665726167655f5f6d61696e2e6a736f6e)](https://github.com/eboreum/exceptional/actions)[![PHPStan Level](https://camo.githubusercontent.com/75d75c40fc6d4ffa05344bad0cdede60b68b5b5385b0de485d451448c33ef616/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f676973742e67697468756275736572636f6e74656e742e636f6d2f6b61666f736f2f61366534666664343038396535653661313365333037633730373834396562372f7261772f7068707374616e2d6c6576656c5f5f6d61696e2e6a736f6e)](https://github.com/eboreum/exceptional/actions)

Create and format PHP exceptions easily. Automatically unravel method arguments. Ensure that sensitive strings like passwords, tokens, PHPSESSID, etc. are being masked and thus will instead appear as e.g. "\*\*\*\*\*\*" in the resulting text.

When a method is called, and somehow that leads to an exception/throwable being raised, wouldn't it be nice knowing all arguments a method was called with? Exceptional can unravel that for you and present these arguments with their respective names in a concise and meaningful way. Additionally, the integration with Eboreum/Caster () allows revealing of information about the object within which the exception/error occured. This is sometimes valuable and crucial information, and it is superb for debugging.

Requirements
============

[](#requirements)

```
"php": "^8.3",
"eboreum/caster": "^2.1"
```

For more information, see the [`composer.json`](composer.json) file.

Installation
============

[](#installation)

Via [Composer](https://getcomposer.org/) ():

```
composer install eboreum/exceptional

```

Via GitHub:

```
git clone git@github.com:eboreum/exceptional.git

```

Fundamentals
============

[](#fundamentals)

Exception message generation
----------------------------

[](#exception-message-generation)

### Example 1: The basics

[](#example-1-the-basics)

**Example:**

```
