Closed Bug 1179876 Opened 5 years ago Closed 4 years ago

Add links to an "MDN error reference" from console errors

Categories

(DevTools :: Console, defect)

defect
Not set
normal

Tracking

(firefox49 fixed, relnote-firefox 49+)

RESOLVED FIXED
Firefox 49
Tracking Status
firefox49 --- fixed
relnote-firefox --- 49+

People

(Reporter: fscholz, Assigned: fscholz)

References

(Depends on 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file, 2 obsolete files)

The web console emits thousands of error messages to web developers everyday. While seasoned web developers understand what is going on, especially beginners need help to understand them. Often the message gets copied, put into google, and answered on Stackoverflow.

What we could do is adding a [Learn More] link to error messages (like we already do for warnings, see CORS), so that we offer developers a direct way to get to know more about what just happened.

This could also be an icon to reduce the text noise (say a question mark in a circle).

More information is available in this etherpad: https://etherpad.mozilla.org/webconsole-mdn-error-msg and the discussion is happening here: https://groups.google.com/forum/#!topic/mozilla.dev.developer-tools/zUiTSyjIvOs

This bug is about the devtools implementation in the console.

The current [Learn More] function lives here: https://dxr.mozilla.org/mozilla-central/source/browser/devtools/webconsole/webconsole.js#1693

A link to the error docs could look like his:
https://developer.mozilla.org/docs/Web/JavaScript/Errors/JSMSG_BAD_RADIX

where "JSMSG_BAD_RADIX" is an "errorNumber" from https://dxr.mozilla.org/mozilla-central/source/js/src/js.msg

I will file a depended bug to get "errorNumber" added to nsIScriptError.
Depends on: 1179879
Depends on: 1179881
See Also: → 1245877
Duplicate of this bug: 1245877
Depends on: 1259563
No longer depends on: 1259563
Release Note Request (optional, but appreciated)
[Why is this notable]: Great new features for developers - http://imgur.com/EOztwbI
[Suggested wording]: Console errors provide links to an "MDN error reference"
[Links (documentation, blog post, etc)]: having a doc would help
relnote-firefox: --- → ?
Attachment #8758019 - Flags: review?(winter2718)
Comment on attachment 8758019 [details] [diff] [review]
Add more doc links to console errors

Review of attachment 8758019 [details] [diff] [review]:
-----------------------------------------------------------------

So much \m/! :)
Attachment #8758019 - Flags: review?(winter2718) → review+
Attached patch errordocs.patch (obsolete) — Splinter Review
Okay, some more docs written. Let's land these :)
Attachment #8758019 - Attachment is obsolete: true
Attachment #8758916 - Flags: review+
Morgan, I updated the patch to include some more docs. Can you land this? I have no clue how to do that properly and might not have required permissions etc.
Flags: needinfo?(winter2718)
(In reply to Florian Scholz [:fscholz] (MDN) from comment #6)
> Morgan, I updated the patch to include some more docs. Can you land this? I
> have no clue how to do that properly and might not have required permissions
> etc.

No problem, will land the patch tonight.
Flags: needinfo?(winter2718)
Pushed by mphillips@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8203279f09e3
Permafails browser_webconsole_bug_653531_highlighter_console_helper.js; r=backout
Comment on attachment 8758916 [details] [diff] [review]
errordocs.patch

Review of attachment 8758916 [details] [diff] [review]:
-----------------------------------------------------------------

I did a poor job reviewing this my first pass through. There is a bug here that needs fixin' also the bug number in the commit message is wrong.

::: devtools/server/actors/errordocs.js
@@ +51,3 @@
>  };
>  
> +exports.GetURL = (errorName) => baseURL + ErrorDocs[errorName];

This should be something like:

exports.GetURL = (errorName) => {
    let doc = ErrorDocs[errorName];
    if (doc)
        return baseURL + doc;
    return undefined;
}

Otherwise every possible error will return a learn more link to baseURL/undefined.
Attachment #8758916 - Flags: review+
s/possible error/error that doesn't have a doc url/
Attached patch errordocs.patchSplinter Review
Attachment #8758916 - Attachment is obsolete: true
Attachment #8759587 - Flags: review?(winter2718)
https://hg.mozilla.org/mozilla-central/rev/8203279f09e3
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
Yup, this was backed out. Revised patch is attached. Sorry for the trouble.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #8759587 - Flags: review?(winter2718) → review+
Relnote 49+ with the suggested wording "Console errors provide links to an "MDN error reference"
(In reply to Marcia Knous [:marcia - use ni] from comment #16)
> Relnote 49+ with the suggested wording "Console errors provide links to an
> "MDN error reference"

I assume this will eventually be in https://developer.mozilla.org/en-US/Firefox/Releases/49#Changes_for_Web_developers, so when it lands there I can just point to it in the release notes if necessary.
Pushed by mphillips@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b9e7c2e445f4
Add more doc links to console errors; r=mrrrgn
https://hg.mozilla.org/mozilla-central/rev/b9e7c2e445f4
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
Florian, is https://developer.mozilla.org/en-US/Firefox/Releases/49#Developer_Tools enough, or should it also be mentioned somewhere else?

Sebastian
Assignee: nobody → fscholz
Flags: needinfo?(fscholz)
See Also: → 1261877, 1274005
Thanks Sebastian! I've updated the docs with a link to the Hacks blog post and added the gif showing the feature to the console page.

(In reply to Marcia Knous [:marcia - use ni] from comment #17)
> (In reply to Marcia Knous [:marcia - use ni] from comment #16)
> > Relnote 49+ with the suggested wording "Console errors provide links to an
> > "MDN error reference"
> 
> I assume this will eventually be in
> https://developer.mozilla.org/en-US/Firefox/Releases/
> 49#Changes_for_Web_developers, so when it lands there I can just point to it
> in the release notes if necessary.

https://hacks.mozilla.org/2016/06/helping-web-developers-with-javascript-errors/ has the best summary of this feature. I would link to this blog post from the release notes.
Flags: needinfo?(fscholz)
49 release notes updated with a link to the blog post, thanks!
Blocks: 1279195
See Also: → 1282745
Depends on: 1278842
Depends on: 1290074
This bug as about to implement "links to an 'MDN error reference' from console errors" as mentioned as #comment0 . I have seen the features being implemented with Beta 49.0 on Windows 7, 64 Bit !

This bug's fix is verified with latest Beta 49.0

Build   ID  20160912134115
User Agent  Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0

[bugday-20160914]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.