Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

better coloration on error messages

#249

this patch makes it so that on rails' code based error messages, the filename is shown in red, so that people can identify more easily which file they need to go and edit. I like it for helping it stand out more, but not too much. Purely aesthetic, but nice.

-R

Reported by Roger · May 23rd, 2008 @ 10:53 PM

State: stale
Milestone: none
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Roger
    Roger

    to test this patch apply, then add a syntax error to a view, and go to that view. It should have a red filename now [dark red].

    May 23rd, 2008 @ 11:01 PM

  2. Roger
    Roger

    This version of the patch [v2] now adds coloration for the line on which the error occurred.

    May 23rd, 2008 @ 11:35 PM

  3. Roger
    Roger

    v3 takes out an extra line I had added in there by mistake

    May 23rd, 2008 @ 11:40 PM

  4. Roger
    Roger

    v4 combine all commits into a single commit, add better colors. This is a nice patch for being able to instantly see which line your code erred on.

    May 24th, 2008 @ 12:20 AM

  5. Adam S
    Adam S

    +1

    Errors can definitely be improved in Rails (see mod_rails errors for an example), these changes don't go a long way, but also don't hurt.

    May 24th, 2008 @ 01:31 PM

  6. Pratik
    Pratik
    • Assigned user set to Pratik
    • State changed from new to incomplete
    • Milestone cleared.

    I tried it and it was very difficult to see the red color. I think you should discuss this change in rails core mailing list. There might be other similar places where we can improve error reporting.

    June 17th, 2008 @ 05:24 PM

  7. Roger
    Roger

    I almost wonder if it wouldn't be even more helpful to include more with the error messages. Like an inspection of the controller's local variables. My thought is to [eventually] post some prototype error pages so we can decide on a reasonable color scheme. mod_rails style might work, too. They're nice.

    Thanks.

    -R

    June 20th, 2008 @ 07:22 PM

  8. Roger
    Roger
    • Tag set to edge, patch

    At least with MRI, it appears possible to snapshot local variables and parameters as to what they were passed in--might make for a nicer output.

    January 11th, 2009 @ 05:39 AM

  9. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)
    • State changed from incomplete to stale

    January 22nd, 2010 @ 08:52 AM