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(11y ago)0701MITPHP

Since Jun 22Pushed 11y ago1 watchersCompare

[ Source](https://github.com/praswicaksono/exception-handling-middleware)[ Packagist](https://packagist.org/packages/jowy/exception-handling-middleware)[ RSS](/packages/jowy-exception-handling-middleware/feed)WikiDiscussions master Synced 2d 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 47% 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

4030d 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

[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k869.4M8.8k](/packages/symfony-http-kernel)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[api-platform/metadata

API Resource-oriented metadata attributes and factories

275.0M219](/packages/api-platform-metadata)[sunrise/http-router

A powerful solution as the foundation of your project.

17451.6k10](/packages/sunrise-http-router)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28150.5k](/packages/phpro-http-tools)[middlewares/whoops

Middleware to use Whoops as error handler

34211.0k28](/packages/middlewares-whoops)

PHPackages © 2026

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