-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Decorate standard error.html.twig template #27071
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
Conversation
zorn-v
commented
Apr 27, 2018
•
edited by nicolas-grekas
Loading
edited by nicolas-grekas
Q | A |
---|---|
Branch? | 3.4 |
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Fixed tickets | #22964 |
License | MIT |
It does not resolve GLOBAL problems that discussed in appropriate tickets. It just brings nice default error page for standard symfony installation in prod env. |
Guys, it just update OLD (check it out) ugly standard twig template. Nothing more. |
I'm 👎 because these are templates that are shown in production environment so we should show something as neutral as possible (they should be overridden on each projects to match your site style). |
You prefer to see "White page with 'Oops'" ? |
At least remove the exception-ghost as this is not really an exception, and non-technical users might be confused about this. |
Yep, I expected it 😄 |
Yes, mainly because the framework should not expose itself in prod. That exception ghost and the page layout you chose do exactly that. Also, that error page is end-user facing. That user probably does not know what an exception is. The fact that Symfony uses exceptions to produce 40x/50x error pages is an implementation detail that the original layout hides. The red color indicates that the user did something wrong, which is not necessarily the case.
Please try to use a more respectful language. |
And users of freamework says. It is UGLY. Just coz dont configure error pages... |
When I show error page (not configured 404) from |
technically, the framework already exposes itself: the basic page is still something specific to Symfony, if one were to build heuristics to snif which code is generating this page. I like the goal here personally. |
Yes, and even without the error pages, you can probably tell by analyzing runtime behavior like HTTP headers etc. My comment was not security-related. I'd rather like avoid to use Symfony branding on end-user facing templates which the exception ghost and the layout with the read header are. Users seeing that page should get the impression that there's something broken with the application they're using. They should not get the impression of a "broken Symfony", imho.
Agreed. I'm not against changing the default error page in general. I just have concerns regarding the layout proposed in this PR. |
Why ? Is it not cool, knowing that some site using symfony ? ) Just changed template. At all |
BTW. I like 'branding' of symfony. |
Nah. Is "Oops" white page not "Symfony branding" ? Disgrace ? |
Again, I don't think calling the work of someone a "disgrace" is a helpful contribution to a discussion. |
Shouldn't we just remove the ghost and keep the rest? It'd look OK to me. |
I disagree with this proposal too. The reason is that I don't want to make users think that it's OK to not customize the error pages in their apps. That's why our default error pages in prod should look like real and finished error pages. Also, not leaking any detail or information about Symfony is nice ... although some people can now associate the "Oops ..." message to Symfony. |
Either we refuse this proposal, or we fix #22964. Right now we have a mix. |
I remove "exception" cloud, when I be able.
And because of this we provide ugly pages (BTW, in SILEX it MUCH BETTER). |
@zorn-v looks great to me. Could you please update the ghost in the Debug component also? The word exception is used in prod there also, but this is not desired. |
Is it ok, that typehints are removed from constructor for 3.4 compat ? |
Yes it is. Is it required? Tests fail without? |
Nope, but I think I make mistake when used |
This is not a bug fix so master is correct :) |
Yep, this is not bugfix. But WHY users of "old" versions of symfony (coz not php 7.1 on server) should see white page ? |
Because we cannot support everyone. We have policies and they help us keep the maintenance burden handleable. |
I agree. One time step against... and we have anarchy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With minor comment.
We must display something, and however raw we may want it, it doesn't have to be ugly.
Also the current situation is inconsistent, with the themed page being displayed in prod also by the Debug component, while the B&W one is when Twig is enabled.
@@ -36,7 +36,7 @@ class ExceptionHandler | |||
private $caughtLength; | |||
private $fileLinkFormat; | |||
|
|||
public function __construct(bool $debug = true, string $charset = null, $fileLinkFormat = null) | |||
public function __construct($debug = true, $charset = null, $fileLinkFormat = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eeeh. I asked about this )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, BTW
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the answer :)
The composer.json of the component states that php7.1 is required, so scalar type hints can be used.
EXACTLY. |
I'm still 👎 about this proposal. The proposed decoration feels "out of place" for prod pages. The "Symfony ghost" and the rest of elements have been created for the dev pages. If we want to display a non-ugly error page, we could do something like this, which is totally agnostic and doesn't leak any Symfony design or information: |
Smells like discrimination. Users of my projects not worthy cool error page if I lazy to override it ? |
Yep. |
👎 Mostly because:
I'm happy with @javiereguiluz proposal, I think google got it right, and nothing better to show to the users than something they are used to. |
You could override it, no ? |
But nobody seems this problem before, yaah. |
@zorn-v please don't misunderstand me/us. We are grateful for your contribution. AFAIK PR's are reviewed by the community, and i think something that doesn't please the majority, usually the author has to re-consider and take in consideration others opinions. I think the majority, currently, is engaged with the idea (so good job!) but the template used is inadequate.
This also applies to you, everyone can override... But this PR will change everyone's template (no one would merge something, only to have it overridden on millions of projects...). Not that i would override this template, but for the reasons i stated i won't be happy with this template either.
To be honest, for the reasons above... the blank pages suffice for my needs. I think i can speak for all of us, when i say, we try to avoid errors (so styling this error page has never been a priority for many of us). The current blank page, states that there is an error in a way i am sure the user will understand something was off with his request. This PR could fix some issues like sending the user back to homepage. It's up for the authors of symfony to decide, as they have the last word. But currently, it would be a lot easier just to change it to match the majority expectations. If i may ask you, what are the reasons for you to keep this red template? (similar to debug / dev pages) ? |
Yep. Same for me. But I was asked of my friend wich I learn for symfony. Why is my old project (in silex) have cool error page, but symfony one not. |
@zorn-v I'm sorry but that's not a good reason to keep a red template (re-use the debug / dev template), so we can have a "cool" error page. I think in such special cases you would indeed override the template in your project... But since you already had all this work, what about doing what @javiereguiluz purposed above? or something similar? that would be great, and if you ask me you would be cool as any sf contributor 😎 , here take yours 🕶 |
@zorn-v as you can see in the previous comments, most people are in favor of a simpler error page design. This doesn't mean that you are wrong; it's just that we think differently about this. For this reason I've made some changes in your original pull request to implement this simpler design. This is how it looks: It uses the same font stack as used by modern CSS frameworks and it uses the same red color shade as the "danger" text color of Bootstrap 4, ensuring a right contrast ratio. Thanks! |
…reguiluz) This PR was merged into the 4.2-dev branch. Discussion ---------- Redesigned the default error page in production | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #22964 | License | MIT | Doc PR | - This continues the work done in #27071. Before/After comparison:  Commits ------- 1df8b3e Redesigned the default error page in production
Thanks, guys 😄 |