Closed leandrocp closed 1 year ago
It feels like we should just format the whole error message as <code>
, because they are written with assumption they will be printed monospaced?
It feels like we should just format the whole error message as
<code>
, because they are written with assumption they will be printed monospaced?
Do you mean the error message from the original code? 🤔 The problem here is that Exception.message/1
does return a string with no line breaks, that's why I had to reformat as inspect(term, pretty: true, limit: :infinity)
Let’s change Elixir to use pretty for this message and also change Plug to use code style for the error message :)
Gotcha. I can send a PR to Elixir and then update this one.
So that's how a simple message would like:
And how a long KeyError would like:
I think we can keep the style closer to what you had: grey and smaller font. :)
I think we can keep the style closer to what you had: grey and smaller font. :)
For all error messages like the MatchError
example above? Because they all share the same style.
That's how it would like, grey and smaller font:
A regular exception:
And KeyError with pretty: true
:
Perfect. Let's do said changes and for all error messages. :)
:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:
I couldn't find such proposal in past issues/PRs so this one is a simple PoC to gather feedback if that's a good idea or not.
In short, currently the debugger page looks like this:
And the idea is to improve UX by displaying this:
Notes:
Exception.message/1
seems okay to deal with some exceptions but it could get out of sync with Elixir stdlib if wording changes.