Closed
Bug 907327
Opened 11 years ago
Closed 10 years ago
Add mapping from XPCOM error codes (nsresult) to symbolic error names like PR_ErrorToString does for NSPR errors
Categories
(Core :: XPCOM, enhancement)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: briansmith, Assigned: anujagarwal464)
References
(Blocks 1 open bug)
Details
Attachments
(4 files, 4 obsolete files)
4.08 KB,
patch
|
Details | Diff | Splinter Review | |
4.62 KB,
patch
|
Details | Diff | Splinter Review | |
4.42 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
4.74 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
This will be useful for improving error messages in tests. This kind of error mapping is already being done by the networking dashboard. I'm just proposing it to be moved to XPCOM.
Reporter | ||
Comment 1•11 years ago
|
||
Assignee: nobody → brian
Status: NEW → ASSIGNED
Reporter | ||
Updated•10 years ago
|
Assignee: brian → nobody
Comment 2•10 years ago
|
||
Brian, did you just not see this as useful and dropped it, or did you just decide to focus your efforts elsewhere, still seeing this as useful?
Flags: needinfo?(brian)
Reporter | ||
Comment 3•10 years ago
|
||
(In reply to Nathan Froyd (:froydnj) from comment #2) > Brian, did you just not see this as useful and dropped it, or did you just > decide to focus your efforts elsewhere, still seeing this as useful? I think it would be helpful. This is one of the many bugs I dropped when I stopped working for MoCo. It would be great if somebody picked it up.
Flags: needinfo?(brian)
I may take a look at finishing this out in a bit. Related to this, I noticed that js/xpconnect/src/xpc.msg maintains a mapping of (some) error codes to their symbolic names (plus some string explanations too). Perhaps both use cases can be unified in some way.
No, I haven't done anything here yet. Feel free to take it if you'd like to!
Flags: needinfo?(jryans)
Comment 7•10 years ago
|
||
Anuj, is this something you would be interested in doing?
Flags: needinfo?(anujagarwal464)
Assignee | ||
Comment 8•10 years ago
|
||
ok :)
Assignee: nobody → anujagarwal464
Flags: needinfo?(anujagarwal464)
Assignee | ||
Comment 9•10 years ago
|
||
Attachment #8507905 -
Flags: feedback?(nfroyd)
Assignee | ||
Comment 10•10 years ago
|
||
Attachment #8507906 -
Flags: feedback?(nfroyd)
Comment 11•10 years ago
|
||
Comment on attachment 8507905 [details] [diff] [review] bug792989-part1.diff Review of attachment 8507905 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, just some small nits. ::: xpcom/base/ErrorNames.cpp @@ +1,1 @@ > +#include "mozilla/ErrorNames.h" This file needs a license header at the top, as well as appropriate editor modelines. Please see: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line @@ +1,2 @@ > +#include "mozilla/ErrorNames.h" > +#include "mozilla/ArrayUtils.h" Please alphabetically sort the header #includes. @@ +2,5 @@ > +#include "mozilla/ArrayUtils.h" > +#include "nsString.h" > +#include "prerror.h" > + > +using namespace mozilla; This bit shouldn't be necessary, since all the interesting things in this file are defined inside |namespace mozilla { }|. @@ +26,5 @@ > + > +namespace mozilla { > + > +void > +GetErrorName(nsresult rv, /*out*/ nsACString & name) No space between nsACString and &, please. The /*out*/ comment is also unnecessary. ::: xpcom/base/ErrorNames.h @@ +16,5 @@ > +// GetErrorName(NS_OK, name) will result in name == "NS_OK". > +// When the symbolic name is unknown, name will be of the form > +// "NS_ERROR_GENERATE_SUCCESS(<module>, <code>)" or > +// "NS_ERROR_GENERATE_FAILURE(<module>, <code>)". > +void GetErrorName(nsresult rv, /*out*/ nsACString & name); Likewise with the |name| parameter here. ::: xpcom/base/moz.build @@ +88,5 @@ > > # nsDebugImpl isn't unified because we disable PGO so that NS_ABORT_OOM isn't > # optimized away oddly. > SOURCES += [ > + 'ErrorNames.cpp', Please include this in UNIFIED_SOURCES instead of SOURCES.
Attachment #8507905 -
Flags: feedback?(nfroyd) → feedback+
Comment 12•10 years ago
|
||
Comment on attachment 8507906 [details] [diff] [review] bug792989-part2.diff Review of attachment 8507906 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, just requires some small changes. ::: netwerk/base/src/Dashboard.cpp @@ +914,3 @@ > } > + } > + nsCString errorCString; I think I'd make this an nsAutoCString. ::: xpcom/base/ErrorNames.cpp @@ -26,5 @@ > > namespace mozilla { > > void > -GetErrorName(nsresult rv, /*out*/ nsACString & name) This change can be removed once you have nsACString& in the previous patch. ::: xpcom/base/ErrorNames.h @@ +16,5 @@ > // GetErrorName(NS_OK, name) will result in name == "NS_OK". > // When the symbolic name is unknown, name will be of the form > // "NS_ERROR_GENERATE_SUCCESS(<module>, <code>)" or > // "NS_ERROR_GENERATE_FAILURE(<module>, <code>)". > +void GetErrorName(nsresult rv, /*out*/ nsACString &name); Likewise.
Attachment #8507906 -
Flags: feedback?(nfroyd) → feedback+
Assignee | ||
Comment 13•10 years ago
|
||
Attachment #8507905 -
Attachment is obsolete: true
Attachment #8507906 -
Attachment is obsolete: true
Attachment #8508015 -
Flags: review?(nfroyd)
Assignee | ||
Comment 14•10 years ago
|
||
Attachment #8508016 -
Flags: review?(nfroyd)
Assignee | ||
Comment 15•10 years ago
|
||
Try: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=aeed80b316c4
Comment 16•10 years ago
|
||
Comment on attachment 8508015 [details] [diff] [review] bug792989-part1.diff Review of attachment 8508015 [details] [diff] [review]: ----------------------------------------------------------------- ::: xpcom/base/moz.build @@ +40,5 @@ > > EXPORTS += [ > 'CodeAddressService.h', > 'ErrorList.h', > + 'ErrorNames.h', It looks like this should be exported in EXPORTS.mozilla according to your try build.
Attachment #8508015 -
Flags: review?(nfroyd)
Assignee | ||
Comment 17•10 years ago
|
||
Attachment #8508015 -
Attachment is obsolete: true
Assignee | ||
Comment 18•10 years ago
|
||
Try: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=8858d81915d5
Assignee | ||
Updated•10 years ago
|
Attachment #8508178 -
Flags: review?(nfroyd)
Updated•10 years ago
|
Attachment #8508178 -
Flags: review?(nfroyd) → review+
Comment 19•10 years ago
|
||
Comment on attachment 8508016 [details] [diff] [review] bug792989-part2.diff Review of attachment 8508016 [details] [diff] [review]: ----------------------------------------------------------------- ::: netwerk/base/src/Dashboard.cpp @@ +1,1 @@ > +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ Please remove this line.
Attachment #8508016 -
Flags: review?(nfroyd) → feedback+
Assignee | ||
Comment 20•10 years ago
|
||
Attachment #8508016 -
Attachment is obsolete: true
Attachment #8509566 -
Flags: review?(nfroyd)
Updated•10 years ago
|
Attachment #8509566 -
Flags: review?(nfroyd) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 21•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/3333c226a1d8 https://hg.mozilla.org/integration/mozilla-inbound/rev/83f801de85fb
Keywords: checkin-needed
Comment 22•10 years ago
|
||
(In reply to Carsten Book [:Tomcat] from comment #21) > https://hg.mozilla.org/integration/mozilla-inbound/rev/3333c226a1d8 > https://hg.mozilla.org/integration/mozilla-inbound/rev/83f801de85fb also relanded in remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/9965ddd32fd6 remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/2a1cd73f279c sicne the inital commit had a wrong bug number in it
Comment 23•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9965ddd32fd6 https://hg.mozilla.org/mozilla-central/rev/2a1cd73f279c
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in
before you can comment on or make changes to this bug.
Description
•