PHPackages                             alexwhitman/enhanced-exception-handler - 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. alexwhitman/enhanced-exception-handler

AbandonedArchivedLibrary

alexwhitman/enhanced-exception-handler
======================================

Enhanced exception handler for Laravel

1.2.0(11y ago)36021MITPHPPHP &gt;=5.3.0

Since Oct 20Pushed 11y ago1 watchersCompare

[ Source](https://github.com/alexwhitman/laravel-enhanced-exception-handler)[ Packagist](https://packagist.org/packages/alexwhitman/enhanced-exception-handler)[ Docs](http://github.com/alexwhitman/laravel-enhanced-exception-handler)[ RSS](/packages/alexwhitman-enhanced-exception-handler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Enhanced Exception Handler (for Laravel)
========================================

[](#enhanced-exception-handler-for-laravel)

Provides a slightly enhanced exception handler to allow the re-throwing of exceptions.

Why?
----

[](#why)

Imagine you have the following code:

```
App::error(function(Illuminate\Database\Eloquent\ModelNotFoundException $exception)
{
	throw new Symfony\Component\HttpKernel\Exception\HttpException(404, null, $exception);
});

App::error(function(Symfony\Component\HttpKernel\Exception\HttpException $exception)
{
	return View::make('404');
});

Route::get('/', function() {
	$user = User::findOrFail(100);
});

```

If user 100 doesn't exist an `Illuminate\Database\Eloquent\ModelNotFoundException` will be thrown and caught by the first exception handler. The handler will then try to thrown a new `Symfony\Component\HttpKernel\Exception\HttpException` but the core framework will stop at this point and echo the message "Error in exception handler". This package changes the exception handling to allow throwing of exceptions from within a handler and in the above example will result in the 404 view being returned.

### Recursion

[](#recursion)

By allowing recursive handling of exceptions it's possible to get stuck in a loop if the handler for `FooException` throws `BarException` and then the handler for `BarException` throws `FooException`. Because of this the handler will keep track of the exceptions it has previously seen and bail if the same type of exception is seen more than once.

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

[](#installation)

Add `alexwhitman/enhanced-exception-handler` to the `require` section of your `composer.json` file.

`"alexwhitman/enhanced-exception-handler": "1.2.x"`

Run `composer update` to install the latest version.

Setup
-----

[](#setup)

The core exception handler service provider is registered very early in the process and so can't be replaced by simply changing the service provider registered in `app/config/app.php`. Instead, a new `Application` object is required to register the new handler.

To use the new `Application` object, update `bootstrap/start.php` and replace `$app = new Illuminate\Foundation\Application;` with `$app = new AlexWhitman\EnhancedExceptionHandler\Application;`.

Changelog
---------

[](#changelog)

### 1.2.0

[](#120)

- Update for Laravel 4.2

### 1.1.1

[](#111)

- Fix for laravel/framework &gt;= 4.1.25

### 1.1.0

[](#110)

- Update for Laravel 4.1

### 1.0.0

[](#100)

- Initial release

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

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

Total

4

Last Release

4346d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2fe69860a20b25732de019cbbc15505b30c9c8351c173765038c77b8fe4e6e1e?d=identicon)[alexwhitman](/maintainers/alexwhitman)

---

Top Contributors

[![alexwhitman](https://avatars.githubusercontent.com/u/422013?v=4)](https://github.com/alexwhitman "alexwhitman (5 commits)")

---

Tags

laravelexceptions

### Embed Badge

![Health badge](/badges/alexwhitman-enhanced-exception-handler/health.svg)

```
[![Health](https://phpackages.com/badges/alexwhitman-enhanced-exception-handler/health.svg)](https://phpackages.com/packages/alexwhitman-enhanced-exception-handler)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[api-platform/laravel

API Platform support for Laravel

59126.4k5](/packages/api-platform-laravel)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3691.5k](/packages/codewithdennis-larament)

PHPackages © 2026

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