10000 [Debug] Design tweaks · Issue #11341 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Debug] Design tweaks #11341

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

Closed
alsar opened this issue Jul 7, 2014 · 12 comments
Closed

[Debug] Design tweaks #11341

alsar opened this issue Jul 7, 2014 · 12 comments
Labels
Debug DX DX = Developer eXperience (anything that improves the experience of using Symfony)

Comments

@alsar
Copy link
alsar commented Jul 7, 2014

Currently the error message is not very readable in my opinion, because the exception name and the exception message stick together. Also the message is not aligned on the left side if it's spread over multiple lines.

I propose something like this:

Maybe the error message could also be separate section with it's own background.
What do you think?

@stof stof added the Debug label Jul 7, 2014
@weaverryan
Copy link
Member

It looks better to me, and there's no downside I can think of.

If someone wants to try to tweak this and make a PR, that would be awesome!

@xabbuh
Copy link
Member
xabbuh commented Jul 26, 2014

Can someone explain which files need to be modified and when they are used? From a quick search I noticed that there are a lot of files defining CSS rules for the HTML elements being used here.

@weaverryan
Copy link
Member

I think error (which is not the normal big nice exception template" is entirely in this file (including the CSS): https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Debug/ExceptionHandler.php

Good question @xabbuh :)

@wouterj
Copy link
Member
wouterj commented Jul 26, 2014

I think @alsar is using an older Symfony version. In Symfony 2.5, I get this:

@sstok
Copy link
Contributor
sstok commented Jul 26, 2014

@wouterj it depends, early exceptions (before the request) use the debug component for exception handling.

@wouterj
Copy link
Member
wouterj commented Jul 26, 2014

@sstok but my exception is equal to @alsar 's exception. They are both triggered by an undefined method on thrpe request object

@xabbuh
Copy link
Member
xabbuh commented Jul 26, 2014

I think @wouterj is right. I can reproduce the output with Symfony 2.3. With Symfony 2.5, I get the same view as in @wouterj's screenshot.

@nicolas-grekas
Copy link
Member

In fact the first screenshot is from Symfony 2.6-dev (#10921), the second from Symfony 2.5, and @sstok is right: before the request event, the "no color" handler is used, generated by:
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Debug/ExceptionHandler.php

Then after the request event, the "colored" one is:
https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.html.twig

@henrikbjorn
Copy link
Contributor

@wouterj the difference is that the standard edition uses TwigBundle which contains different templates than what the Debug component spits out.

edit: which is what @nicolas-grekas wrote, damn i need to read before responding.

@wouterj
Copy link
Member
wouterj commented Jul 27, 2014

@nicolas-grekas so the design actually got worse in the latest Symfony version? That doesn't sound correc to me :)

And it's nice to know that another handler is used based on the location of the error (I didn't know that), but it has nothing to do with the difference, since both screenshots have the same error (which depends on the Request object, so we are sure we are after the request event).

Wait, sorry. Stupid me, my last paragraph is not true. The location is different and by that, the design is different. I propose to make the design consistent.

@nicolas-grekas
Copy link
Member

This is how error handling works since 2.3 or 2.4:

  • before the kernel is started, a basic error/exception handler is registered. This one outputs the no-color screenshot. In 2.6, this changed marginally (and is going to be enhanced again here).
  • later, on "request" event, a better handler is registered instead. "Better" being for "more flexible" since e.g. standard Symfony configuration is possible, Twig is available, etc.

This is a bootstrap process: errors can happen before the request event, and we want to see them. But once everything is properly booted, we can have even more sweetness, thus the second handler. There is nothing wrong here.

fabpot added a commit that referenced this issue Aug 26, 2014
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Debug] fix and enhance exception messages

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11341
| License       | MIT
| Doc PR        | none

Commits
-------

8df1ce8 [Debug] fix and enhance exception messages
@nicolas-grekas
Copy link
Member

Fixed in #11759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Debug DX DX = Developer eXperience (anything that improves the experience of using Symfony)
Projects
None yet
Development

No branches or pull requests

8 participants
0