PHPackages                             jowy/exception-handling-middleware - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. jowy/exception-handling-middleware

ActiveMiddleware[HTTP &amp; Networking](/categories/http)

jowy/exception-handling-middleware
==================================

PSR7 Http Exception Handling Middleware

v1.0(10y ago)0701MITPHP

Since Jun 22Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Atriedes/exception-handling-middleware)[ Packagist](https://packagist.org/packages/jowy/exception-handling-middleware)[ RSS](/packages/jowy-exception-handling-middleware/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (1)

Error Handling Middleware
=========================

[](#error-handling-middleware)

[![Build Status](https://camo.githubusercontent.com/c4458fa43321e9e9ac936dd753500bf824f791c463e20fce50b010401c694231/68747470733a2f2f7472617669732d63692e6f72672f41747269656465732f657863657074696f6e2d68616e646c696e672d6d6964646c65776172652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Atriedes/exception-handling-middleware)

PSR 7 error handling middleware

Intallation &amp; Requirements
------------------------------

[](#intallation--requirements)

Install using composer

```
$ composer require jowy/error-handling-middleware
```

This library has following dependencies:

- `zendframework/zend-diactoros`, used for PSR 7 implementation
- `zendframework/zend-stratigility`, provide abstraction for PSR 7 middleware
- `flip/whoops`, used for error formatting
- `psr/log`, provide abstration for logging

This library has conflict with following library:

- `symfony/http-kernel`, because this library has already used `Symfony\Component\HttpKernel\Exception`, despite require whole `symfony/http-kernel` package it only require the exception class

Usage
-----

[](#usage)

Usage on `zendframework/zend-stratigility`

```
use Zend\Stratigility\MiddlewarePipe;
use Jowy\ExceptionHandler\ExceptionHandler;

$app = new MiddlewarePipe();
$route_middleware = new ExceptionHandler($whoops_output_handler, $psr3_logger, $catch);

$app->pipe($route_middleware);
```

Usage on `relay\relay`

```
use Pimple\Container;
use Relay\Relay;
use Jowy\ExceptionHandler\ExceptionHandler;

$container = new Container();

$container["middleware"] = [
    ExceptionHandler::class => function() {
        return new ExceptionHandler($whoops_output_handler, $psr3_logger, $catch);
    }
];

$resolver = function ($class) use ($container) {
    return $container[$class];
}

new Relay(array_keys($container["middleware"], $resolver);
```

API
---

[](#api)

```
use Psr\Log\LoggerInterface;
use Whoops\Handler\HandlerInterface;

class ExceptionHandler
{
    public function __construct(HandlerInterface $error_handler, LoggerInterface $logger, $catch = true);
}
```

License
-------

[](#license)

MIT, see LICENSE.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Unknown

Total

1

Last Release

3984d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/023a0bd17758df473ae6dad9f07575a8d0a8c36b06e83396b5962aecba38c722?d=identicon)[PrasWicaksono](/maintainers/PrasWicaksono)

---

Tags

psr-7middlewareexception handling

### Embed Badge

![Health badge](/badges/jowy-exception-handling-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/jowy-exception-handling-middleware/health.svg)](https://phpackages.com/packages/jowy-exception-handling-middleware)
```

###  Alternatives

[middlewares/whoops

Middleware to use Whoops as error handler

33205.4k24](/packages/middlewares-whoops)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[bairwell/middleware-cors

A PSR-7 middleware layer for providing CORS (Cross Origin Request Security) headers and security provisions. Instead of just allowing invalid CORs requests to come through, this middleware actively blocks them after validating.

1920.9k1](/packages/bairwell-middleware-cors)[segrax/open-policy-agent

Open Policy Agent client and PSR-7, PSR-15 Authorization Middleware

212.0k](/packages/segrax-open-policy-agent)

PHPackages © 2026

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