Bug 18983

Summary: Exception messages in console not always obvious
Product: WebKit Reporter: Oliver Hunt <oliver>
Component: Web Inspector (Deprecated)Assignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed Patch
aroben: review+
Screenshot of new design none

Description Oliver Hunt 2008-05-10 00:17:09 PDT
Doing the following example in the console:
q=({valueOf:function(){console.log("argh"); throw "foo";}})
q++

Will result in a small red cross, with the text "foo".  It is not obvious however that the  "foo" text is in fact an exception.
Comment 1 Timothy Hatcher 2008-05-10 08:12:17 PDT
What would make it more obvious?
Comment 2 Adam Roben (:aroben) 2008-05-10 10:31:31 PDT
(In reply to comment #1)
> What would make it more obvious?

Maybe something as simple as prefixing the exception with "Exception: " would help.
Comment 3 Oliver Hunt 2008-07-19 23:28:30 PDT
Yeah, i was thinking something along the lines of what adam referred to.
Comment 4 Timothy Hatcher 2009-03-02 10:06:06 PST
This recently regressed a little, we no longer show a small red cross. And some cases the text isn't red. I have a fix that make these cases clear and consistent. Prefixing isn't a trivial change, so I will save that for another rainy day.
Comment 5 Timothy Hatcher 2009-03-02 10:50:16 PST
Created attachment 28184 [details]
Proposed Patch
Comment 6 Timothy Hatcher 2009-03-02 10:50:35 PST
Created attachment 28185 [details]
Screenshot of new design
Comment 7 Adam Roben (:aroben) 2009-03-02 12:53:38 PST
Comment on attachment 28184 [details]
Proposed Patch

>         (WebInspector.Console.prototype._formaterror): Add an error-message
>         classed span around the message to show in red and remove the
>         console-message-url class from the link so it doesn't float right.
>         Instead inclose the link in parenthesis and use displayNameForURL

Typos: inclose -> enclose, parenthesis -> parentheses

>         (WebInspector.ConsoleMessage.prototype.toMessageElement): Simplify
>         how line numbers are shown since link underlining a string with
>         parenthesis looks bad.

Typo: parenthesis -> parentheses

Can you make a manual test?

r=me
Comment 8 Timothy Hatcher 2009-03-02 13:38:46 PST
Landed in r41364.