Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.2k
Description
It like theirs is few missing cases on overridingerror page :
- PHP errors:
If you have PHPerrors like TypeError or Division by zero
Then you can Override theSymfony\Component\HttpKernel\Controller\ErrorController
using the service.yml when in production env.
You will just have the exception to render your page but you still can use Twig.
- Errors that happens before Twig was initialized
This can happen when you do not have a connection to your database for instance.
Then you need to set the template of HtmlErrorRenderer on your kernel :HtmlErrorRenderer::setTemplate($this->getProjectDir().'/templates/error.html');
- The PHP is not responding (503)
It might be good to mention that you should configure a pure html error page on your upper layers like nginx/apache/traffeik/varnish/...
Note : I'm not sure this the best way to solve this issues but I think the doc should mention that you do not catch 100% of errors withOverriding the Default Error Templates orOverriding the Default ErrorController.