Skip to content

Remove the mention of TwigBundle\ExceptionController and extending doc #13222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2020

Conversation

yceruto
Copy link
Member

@yceruto yceruto commented Feb 22, 2020

Fixes #13071
Fixes #12920

I would no longer recommend to extend directly from ErrorController. It adds a new error renderer layer that covers the most common error contexts (CLI, HTTP-html, HTTP-APIs), in the worst case you can decorare them, but it shouldn't be necessary.

@yceruto yceruto changed the title Remove the TwigBundle\ExceptionController mention and extending doc Remove the mention of TwigBundle\ExceptionController and extending doc Feb 22, 2020
@yceruto yceruto changed the base branch from master to 4.4 February 22, 2020 15:59
@yceruto yceruto force-pushed the error_pages branch 2 times, most recently from 3ad44f3 to a3a74c7 Compare February 22, 2020 16:04
@HeahDude HeahDude added this to the 4.4 milestone Feb 22, 2020
Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@wouterj wouterj merged commit 5b7a873 into symfony:4.4 Feb 24, 2020
@wouterj
Copy link
Member

wouterj commented Feb 24, 2020

Thanks Yonel!

Do you think it makes sense to also document how to create your own error renderer? Or is that something that a user shouldn't do? Please create an issue if you want to have it documented, so we don't forget :)

@yceruto yceruto deleted the error_pages branch February 24, 2020 15:44
@yceruto
Copy link
Member Author

yceruto commented Feb 24, 2020

Hi @wouterj, thanks for merge!

About your question, the error renderer layer is something internal and there is no extension point to add a new error renderer easily, besides doing that shouldn't be too common because we've TwigErrorRenderer for HTML error pages and SerializerErrorRenderer for HTTP-API errors, each one with a way for user customization (both have been documented here).

I think there is no need to document how to create a new error renderer as long as there is no new error context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error pages outdated overwriting error controller should be updated for 4.4
5 participants