PHPackages                             webfactory/exceptions-bundle - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. webfactory/exceptions-bundle

AbandonedArchivedSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

webfactory/exceptions-bundle
============================

Building blocks for more user-friendly error pages, plus a simple controller to display error pages during development (helpful prior to Symfony 2.6.3)

5.2.0(2y ago)631.3M↑134.2%142MITTwig

Since Feb 17Pushed 2y ago11 watchersCompare

[ Source](https://github.com/webfactory/exceptions-bundle)[ Packagist](https://packagist.org/packages/webfactory/exceptions-bundle)[ Docs](https://www.webfactory.de/blog/symfony2-exception-handling-and-custom-error-pages-explained)[ RSS](/packages/webfactory-exceptions-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (5)Dependencies (1)Versions (35)Used By (2)

WebfactoryExceptionsBundle
==========================

[](#webfactoryexceptionsbundle)

A Symfony Bundle with some Twig templates and blocks to create helpful, user friendly error pages.

⚠️ **Please note:** At webfactory, we do no longer use this bundle in new projects, since its main functionality was merged into Symfony 2.6 and we prefer to have project-specific templates. However, we still use the wording that we provide with this bundle.

Basic Usage
-----------

[](#basic-usage)

First, follow the [Symfony Documentation](https://symfony.com/doc/current/controller/error_pages.html) to learn how to create and preview custom error pages. Been there, done that? Fine!

Let's say your generic error page extends the base layout of MyWebsiteBundle. Then you may want to have your `error.html.twig` to look something like this:

```
{# error.html.twig #}
{% extends '@MyWebsite/Layout/base.html.twig' %}
{% use '@WebfactoryExceptions/Exception/blocks.html.twig' %}

{% block myMainContentContainer %}
    {{ block('webfactory_exceptions_standardExceptionPage') }}
{% endblock %}

```

The `webfactory_exceptions_standardExceptionPage` block has headings, the translated exception description and provides the user with a list of alternatives what they can do next: get back (simulating a browser back), get to the homepage, get to the contact page or google the domain. It may look like this:

[![Sample rendering of the webfactory_exceptions_standardExceptionPage block](src/Resources/doc/images/webfactory_exceptions_standardExceptionPage-example.png)](src/Resources/doc/images/webfactory_exceptions_standardExceptionPage-example.png)

Links to Homepage and Contact Page
----------------------------------

[](#links-to-homepage-and-contact-page)

A default block in the bundle provides a link to the homepage with the default target `/`. If your application does not start at `/`, you need to set the variable `homepageUrl`.

Also, you may want to set the variable `contactUrl` to get a link to your contact page in the listed alternatives.

```
{# error.html.twig #}
{% extends '@MyWebsite/Layout/base.html.twig' %}
{% use '@WebfactoryExceptions/Exception/blocks.html.twig' %}

{% set homepageUrl = "https://www.webfactory.de" %}
{% set contactUrl = path('name_of_a_route') %}

{# your blocks and definitions... #}

```

Filling in Blocks of Base Layouts
---------------------------------

[](#filling-in-blocks-of-base-layouts)

If your base layout already features blocks you need to fill with exception specific content, you can do it this way:

```
{# error.html.twig #}
{% extends '@MyWebsite/Layout/base.html.twig' %}

{% use '@WebfactoryExceptions/Exception/blocks.html.twig' with
        webfactory_exceptions_error_title as title,
        webfactory_exceptions_error_headline as stage_headline
%}

```

This loads the `webfactory_exceptions_error_title` block *directly* into the `title` block of your base layout, as well as the `webfactory_exceptions_error_headline` block into the `stage_headline` block.

Happy error-styling!

Credits, Copyright and License
------------------------------

[](#credits-copyright-and-license)

This bundle was started at webfactory GmbH, Bonn. It was inspired by the blog post [How Symfony2 turns exceptions into error pages and how to customize those](https://www.webfactory.de/blog/symfony2-exception-handling-and-custom-error-pages-explained).

Previous releases of this bundle contained extra code that would help during development to preview your error pages. This code, however, could be merged into the Symfony core in Symfony 2.6, so we could finally remove it from this bundle. Read the [announcement](https://symfony.com/blog/new-in-symfony-2-6-error-page-previews) when you're interested in historic details.

-
-

Copyright 2012-2022 webfactory GmbH, Bonn. Code released under [the MIT license](LICENSE).

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~502 days

Total

34

Last Release

798d ago

Major Versions

1.0.12 → 2.0.x-dev2013-02-15

1.0.13 → 2.0.02013-02-18

2.0.1 → 3.0.02013-03-19

3.1.0 → 4.0.02014-04-30

4.5.0 → 5.0.02022-04-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4ed0a0f5a1c56f7df31bb8c854a2ad99d24281dc8df4b4d3dd986a9e84b7a24?d=identicon)[webfactory](/maintainers/webfactory)

---

Top Contributors

[![MalteWunsch](https://avatars.githubusercontent.com/u/2504942?v=4)](https://github.com/MalteWunsch "MalteWunsch (34 commits)")[![mpdude](https://avatars.githubusercontent.com/u/1202333?v=4)](https://github.com/mpdude "mpdude (26 commits)")[![drthief](https://avatars.githubusercontent.com/u/243979?v=4)](https://github.com/drthief "drthief (3 commits)")[![weaverryan](https://avatars.githubusercontent.com/u/121003?v=4)](https://github.com/weaverryan "weaverryan (3 commits)")[![FabianSchmick](https://avatars.githubusercontent.com/u/17527958?v=4)](https://github.com/FabianSchmick "FabianSchmick (2 commits)")[![sebastiankugler](https://avatars.githubusercontent.com/u/4364200?v=4)](https://github.com/sebastiankugler "sebastiankugler (2 commits)")[![relthyg](https://avatars.githubusercontent.com/u/8628559?v=4)](https://github.com/relthyg "relthyg (1 commits)")[![MatthiasMolitor](https://avatars.githubusercontent.com/u/1383323?v=4)](https://github.com/MatthiasMolitor "MatthiasMolitor (1 commits)")[![jroenf](https://avatars.githubusercontent.com/u/396417?v=4)](https://github.com/jroenf "jroenf (1 commits)")[![MarioBlazek](https://avatars.githubusercontent.com/u/6605175?v=4)](https://github.com/MarioBlazek "MarioBlazek (1 commits)")[![dritter](https://avatars.githubusercontent.com/u/1544760?v=4)](https://github.com/dritter "dritter (1 commits)")[![nicodmf](https://avatars.githubusercontent.com/u/173332?v=4)](https://github.com/nicodmf "nicodmf (1 commits)")[![polarbirke](https://avatars.githubusercontent.com/u/3763421?v=4)](https://github.com/polarbirke "polarbirke (1 commits)")

### Embed Badge

![Health badge](/badges/webfactory-exceptions-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/webfactory-exceptions-bundle/health.svg)](https://phpackages.com/packages/webfactory-exceptions-bundle)
```

PHPackages © 2026

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