Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ERROR PAGES] Improve override documentation #18737

Open
@JLepeltier

Description

@JLepeltier

It like theirs is few missing cases on overridingerror page :

  1. 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.

  1. 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');

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp