Customizable error pages for Symfony 6.2 and 7+
This bundle replaces Symfony’s default error pages (404, 403, 500, etc.) with user-friendly Twig templates.
- Handles 404, 403, 500, 401 and other HTTP errors
- Shows a login prompt for 401 errors
- Custom Twig templates
Install the bundle via Composer:
composer require lubna/custom-error-bundle
In config/bundles.php
:
return [
CustomError\Bundle\CustomErrorBundle::class => ['all' => true],
];
If you want the bundle to be active only in production, you can use:
return [
CustomError\Bundle\CustomErrorBundle::class => ['prod' => true],
];
In config/services.yaml
:
services:
CustomError\Bundle\Controller\ErrorController:
tags: ['controller.service_arguments']
Made with ❤️ by Lubna
Feel free to contribute, fork, or open issues.