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

Appearance settings

Ease development for error pages #7446

Copy link
Copy link
Closed
@perprogramming

Description

@perprogramming
Issue body actions

It is currently quiet hard to test modifications within custom error pages. It involves the following steps:

  1. Make the exception controller use the right template:
    When in development mode the exception controller defaults to use a template called "exception_". In production it searches for "error_". So you either need to switch to production locally or rename your template temporarily. When switching to production locally Twig will start to cache the compiled templates. So you even need to clear the cache after each modification or deactivate caching in your Twig configuration. It is ugly anyway.
  2. Trigger an exception
    To actually see the error page, an exception has to be thrown. This might still be easy for 404 exceptions (http://localhost/app.php/there/is/no/page/here...), but is more difficult for other exception types (e.g. 403, 500).

Suggestion:

  1. The exception controller should offer a way to make him use the "production" templates within development mode. This could be a configuration variable in TwigBundle.
  2. We could offer routes for exception tests in development mode (e.g. /_exceptions-test/403). This routes would start a controller that just throws the specified exception.
    It would be even nicer if calling the test route would implicitly switch to "production" templates without having to reconfigure TwigBundle.

I have already had a look into TwigBundle and could provide a PR if you like the idea.

Or am I overseeing something existing?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.