Closed
Bug 782471
Opened 13 years ago
Closed 13 years ago
Add file name to JS error when ctypes.Create() fails
Categories
(Core :: js-ctypes, defect)
Core
js-ctypes
Tracking
()
RESOLVED
FIXED
mozilla17
People
(Reporter: Irving, Assigned: Irving)
Details
Attachments
(1 file, 1 obsolete file)
1.14 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
When ctypes.open() fails, the error message does not include the full path of the library that failed to load. Adding this information helped me diagnose https://bugzilla.mozilla.org/show_bug.cgi?id=781628
Assignee | ||
Comment 1•13 years ago
|
||
The #ifdef flow feels a little dirty to me, but the mixture between control flow and platform-specific intermediate variables didn't leave an obvious alternative.
Attachment #651590 -
Flags: review?(bobbyholley+bmo)
Comment 2•13 years ago
|
||
Comment on attachment 651590 [details] [diff] [review]
Patch to add library path to error message
How about making the argument a ternary value, conditional on libSpec.type, that evaluates to either libSpec.value.pathname or libSpec.value.pathname_u? As for the cleanup, we can just store the success of the JS_ReportError call in a local, and then return failures after doing unconditional cleanup.
Attachment #651590 -
Flags: review?(bobbyholley+bmo) → review-
Assignee | ||
Comment 3•13 years ago
|
||
(In reply to Bobby Holley (:bholley) from comment #2)
> Comment on attachment 651590 [details] [diff] [review]
> Patch to add library path to error message
>
> How about making the argument a ternary value, conditional on libSpec.type,
> that evaluates to either libSpec.value.pathname or libSpec.value.pathname_u?
The printf format string varies too; in the Windows case it's %hs to render the 16-bit filename string into an otherwise 8-bit output.
> As for the cleanup, we can just store the success of the JS_ReportError call
> in a local, and then return failures after doing unconditional cleanup.
I've rearranged the #ifdefs a bit, how does this look?
Attachment #651590 -
Attachment is obsolete: true
Attachment #652222 -
Flags: review?(bobbyholley+bmo)
Comment 4•13 years ago
|
||
Comment on attachment 652222 [details] [diff] [review]
Include file path in "failed to load library" error
I'd still prefer to avoid duplicating the JS_free call, but I don't think it's worth quibbling over. r+
Attachment #652222 -
Flags: review?(bobbyholley+bmo) → review+
Assignee | ||
Comment 5•13 years ago
|
||
Checked in to inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/88def2d79ce8
Comment 6•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in
before you can comment on or make changes to this bug.
Description
•