Closed Bug 1265030 Opened 9 years ago Closed 5 years ago

make NS_ENSURE_SUCCESS (and similar) failure messages tell you the nsresult name, rather than hex code

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox48 --- wontfix
firefox77 --- fixed

People

(Reporter: froydnj, Assigned: heycam)

Details

Attachments

(1 file)

It's 2016, we can translate from hex codes to error names. As a bonus, we can make the DEBUG implementation of NS_ENSURE_SUCCESS_BODY take up a lot less space than it's doing now.
There was a bug around somewhere on converting nsError to strings, and I even poked at it a bit, but I can't find it now.

Through their use of Smprintf, the existing warning message formatting
is resistant to OOM errors. So I figured that we should probably use
something that doesn't infallibly allocate like GetErrorName does.

Assignee: nobody → cam
Status: NEW → ASSIGNED

Let me know if there are other places that we print out the numeric nsresult value that we could improve.

I have no idea, sorry.

Pushed by cmccormack@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a0ab13abbe9f Show symbolic nsresult name in NS_ENSURE_SUCCESS warning. r=mccr8
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: