PHPackages                             autologic-web/symfony-json-exceptions - 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. autologic-web/symfony-json-exceptions

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

autologic-web/symfony-json-exceptions
=====================================

Graceful Symfony API errors

0.1.4(7y ago)0463↓80%1[1 PRs](https://github.com/autologic-web/symfony-json-exceptions/pulls)MITPHPPHP ^5.6|^7.0

Since Jun 7Pushed 6y ago5 watchersCompare

[ Source](https://github.com/autologic-web/symfony-json-exceptions)[ Packagist](https://packagist.org/packages/autologic-web/symfony-json-exceptions)[ RSS](/packages/autologic-web-symfony-json-exceptions/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (6)Versions (4)Used By (0)

Symfony JSON Exceptions
=======================

[](#symfony-json-exceptions)

[![Build Status](https://camo.githubusercontent.com/403ec0e5cfe9647d41378ba8ba29fd942e75e0979f8d816432a5a4ea6c89dd3d/68747470733a2f2f7472617669732d63692e6f72672f6175746f6c6f6769632d7765622f73796d666f6e792d6a736f6e2d657863657074696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/autologic-web/symfony-json-exceptions) [![StyleCI](https://camo.githubusercontent.com/94f72d6bfe14de7869b5e94e10f16b151ef280bda987626b95ae95af1d9ade4d/68747470733a2f2f7374796c6563692e696f2f7265706f732f3133363435393037372f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/136459077) [![Maintainability](https://camo.githubusercontent.com/387b7924f72aeee8fd48bdcbf35bad78c3bcbdbbc7f111fff8649f7ca9676b74/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f66383461353266623333333030646661366133622f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/autologic-web/symfony-json-exceptions/maintainability) [![Test Coverage](https://camo.githubusercontent.com/6c5c34e3bd6a8b8f52ffdb3ac5916c2b39d0ef039e0a6eeb8dbe0978fbd1b637/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f66383461353266623333333030646661366133622f746573745f636f766572616765)](https://codeclimate.com/github/autologic-web/symfony-json-exceptions/test_coverage)

### Handle exceptions gracefully in your Symfony APIs.

[](#handle-exceptions-gracefully-in-your-symfony-apis)

```
$ composer install autologic-web/symfony-json-exceptions
```

Include the bundle in `config/bundles.php` in Symfony 4+ or in `AppKernel.php` in Symfony 2+ and you're done for production.

If you want to use pretty exceptions in dev, add the following to the root level of your config, or a new file in Symfony 4+:

```
autologic_json_exceptions:
    pretty_dev: true
```

Compatible with Symfony 2, 3 &amp; 4. PHP 5.3 to 7.2.

Returns consistently formatted errors with title, detail and status. Not found example:

```
{
    "errors": [
        {
            "title": "Not found",
            "detail": "No route found for \"GET /api/silly\"",
            "status": 404
        }
    ]
}
```

Credit to [@dannym87](https://github.com/dannym87) for first implementing this in one of our services. It's now a library for re-use.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Total

3

Last Release

2896d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/24142e4625810d480bfecbe0cc8b5375051bcadc9ebd614c3ff66665f2a275c2?d=identicon)[matt-halliday](/maintainers/matt-halliday)

---

Tags

exceptionsjsonsymfony

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/autologic-web-symfony-json-exceptions/health.svg)

```
[![Health](https://phpackages.com/badges/autologic-web-symfony-json-exceptions/health.svg)](https://phpackages.com/packages/autologic-web-symfony-json-exceptions)
```

###  Alternatives

[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.3k63.6M233](/packages/nelmio-api-doc-bundle)[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k172.9M1.8k](/packages/symfony-security-bundle)[friendsofsymfony/http-cache-bundle

Set path based HTTP cache headers and send invalidation requests to your HTTP cache

43813.2M47](/packages/friendsofsymfony-http-cache-bundle)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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