PHPackages                             httpsoft/http-error-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. [HTTP &amp; Networking](/categories/http)
4. /
5. httpsoft/http-error-handler

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

httpsoft/http-error-handler
===========================

Error handling PSR-7 and PSR-15 components

1.1.1(1y ago)347.4k↑123.1%1MITPHPPHP ^7.4|^8.0

Since Aug 23Pushed 1y ago2 watchersCompare

[ Source](https://github.com/httpsoft/http-error-handler)[ Packagist](https://packagist.org/packages/httpsoft/http-error-handler)[ Docs](https://httpsoft.org/)[ RSS](/packages/httpsoft-http-error-handler/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (7)Dependencies (7)Versions (8)Used By (1)

HTTP Error Handler
==================

[](#http-error-handler)

[![License](https://camo.githubusercontent.com/02a2aed6ef3856f39c7557c71b91cfa1cd08c41094be2fd94cb478e597c6c30c/68747470733a2f2f706f7365722e707567782e6f72672f68747470736f66742f687474702d6572726f722d68616e646c65722f6c6963656e7365)](https://packagist.org/packages/httpsoft/http-error-handler)[![Latest Stable Version](https://camo.githubusercontent.com/25106a4925404b28b1377ca95b4c12ca4fd7e46ecc974055f1416a2d0ced8648/68747470733a2f2f706f7365722e707567782e6f72672f68747470736f66742f687474702d6572726f722d68616e646c65722f76)](https://packagist.org/packages/httpsoft/http-error-handler)[![Total Downloads](https://camo.githubusercontent.com/c1e2932840be6a2920edd1fa141e04d7222b5d658c0e26480710540fa5b2c7bc/68747470733a2f2f706f7365722e707567782e6f72672f68747470736f66742f687474702d6572726f722d68616e646c65722f646f776e6c6f616473)](https://packagist.org/packages/httpsoft/http-error-handler)[![GitHub Build Status](https://github.com/httpsoft/http-error-handler/workflows/build/badge.svg)](https://github.com/httpsoft/http-error-handler/actions)[![GitHub Static Analysis Status](https://github.com/httpsoft/http-error-handler/workflows/static/badge.svg)](https://github.com/httpsoft/http-error-handler/actions)[![Scrutinizer Code Coverage](https://camo.githubusercontent.com/94338f47fb0a409ffc58be47649e5076d7a60f8c9b7d84f63d346ac05f9c289b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68747470736f66742f687474702d6572726f722d68616e646c65722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/httpsoft/http-error-handler/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/70d81722674e66824cc858b39d4d1ac4f936848a357f5d64731d7279a995a215/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68747470736f66742f687474702d6572726f722d68616e646c65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/httpsoft/http-error-handler/?branch=master)

This package implements [Psr\\Http\\Server\\MiddlewareInterface](https://github.com/php-fig/http-server-middleware/blob/master/src/MiddlewareInterface.php) and [Psr\\Http\\Server\\RequestHandlerInterface](https://github.com/php-fig/http-server-handler/blob/master/src/RequestHandlerInterface.php).

Documentation
-------------

[](#documentation)

- [In English language](https://httpsoft.org/docs/error-handler).
- [In Russian language](https://httpsoft.org/ru/docs/error-handler).

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

[](#installation)

This package requires PHP version 7.4 or later.

```
composer require httpsoft/http-error-handler

```

Usage ErrorHandler
------------------

[](#usage-errorhandler)

```
use HttpSoft\ErrorHandler\ErrorHandler;

/**
 * @var Psr\Http\Message\ServerRequestInterface $request
 * @var Psr\Http\Server\RequestHandlerInterface $handler
 *
 * @var HttpSoft\ErrorHandler\ErrorListenerInterface $logErrorListener
 * @var HttpSoft\ErrorHandler\ErrorListenerInterface $sendErrorListener
 * @var HttpSoft\ErrorHandler\ErrorResponseGeneratorInterface $responseGenerator
 */

$errorHandler = new ErrorHandler($handler, $responseGenerator);

$errorHandler->addListener($logErrorListener);
$errorHandler->addListener($sendErrorListener);

/** @var \Psr\Http\Message\ResponseInterface $response */
$response = $errorHandler->handle($request);
```

Usage ErrorHandlerMiddleware
----------------------------

[](#usage-errorhandlermiddleware)

```
use HttpSoft\ErrorHandler\ErrorHandlerMiddleware;

/**
 * @var Psr\Http\Message\ServerRequestInterface $request
 * @var Psr\Http\Server\RequestHandlerInterface $handler
 *
 * @var HttpSoft\ErrorHandler\ErrorListenerInterface $logErrorListener
 * @var HttpSoft\ErrorHandler\ErrorListenerInterface $sendErrorListener
 * @var HttpSoft\ErrorHandler\ErrorResponseGeneratorInterface $responseGenerator
 */

$errorHandler = new ErrorHandlerMiddleware($responseGenerator);

$errorHandler->addListener($logErrorListener);
$errorHandler->addListener($sendErrorListener);

/** @var \Psr\Http\Message\ResponseInterface $response */
$response = $errorHandler->process($request, $handler);
```

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

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

Recently: every ~396 days

Total

7

Last Release

550d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ab952aaa5ac8f82d6e96ef74c2f69082674a97eb3bc62f9d96c7304b2b4b082?d=identicon)[devanych](/maintainers/devanych)

---

Top Contributors

[![devanych](https://avatars.githubusercontent.com/u/20116244?v=4)](https://github.com/devanych "devanych (46 commits)")

---

Tags

error-handlererror-middlewarehttphttp-errorphppsr-15psr-7httppsr-7phppsr-15error-handlererror-middlewarehttp-error

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/httpsoft-http-error-handler/health.svg)

```
[![Health](https://phpackages.com/badges/httpsoft-http-error-handler/health.svg)](https://phpackages.com/packages/httpsoft-http-error-handler)
```

###  Alternatives

[sunrise/http-router

A powerful solution as the foundation of your project.

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

PSR-15 Middleware Microframework

3923.8M125](/packages/mezzio-mezzio)[httpsoft/http-basis

Simple and fast HTTP microframework implementing PSR standards

1343.1k1](/packages/httpsoft-http-basis)[httpsoft/http-runner

Running PSR-7 components and building PSR-15 middleware pipelines

1464.7k6](/packages/httpsoft-http-runner)[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

131.7M39](/packages/mezzio-mezzio-authentication)

PHPackages © 2026

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