Closed Bug 551057 Opened 15 years ago Closed 7 years ago

Improve error messages in ctypes

Categories

(Core :: js-ctypes, defect, P1)

defect

Tracking

()

RESOLVED DUPLICATE of bug 891107
Tracking Status
blocking2.0 --- -

People

(Reporter: dwitte, Unassigned)

References

(Blocks 1 open bug)

Details

+++ This bug was initially created as a clone of Bug #513788 +++ Error messages in ctypes, as implemented in bug 513788, are pretty weak. We should improve them so that TypeErrors etc give nice, understandable messages. Per jorendorff: * The error messages when type conversion fails are pretty weak! I expect users to bump into these pretty often, so please do another pass over them and see if there's any helpful information you can add. A decent type error is like, can't pass the string "xyzzy" to argument 2 of hypot(double, double)
Summary: Revise js-facing API for js-ctypes → Improve error messages in ctypes
From one of jorendorff's myriad review comments in bug 513788: In Library::Create: > library = PR_LoadLibraryWithFlags(libSpec, 0); >- if (!library) >+ if (!library) { >+ JS_ReportError(cx, "couldn't open library"); > return NULL; >+ } Can we get a useful error message out of NSPR? This is another error that's going to be very, very common during development.
FWIW, the error messages we get from Windows/NSPR aren't that useful.
P1, need this for 1.9.3.
Priority: -- → P1
Assignee: nobody → dwitte
blocking2.0: --- → final+
blocking2.0: final+ → -
Reassigning to nobody. If anyone wants to work on this, feel free!
Assignee: dwitte → nobody
Depends on: 1123047
Depends on: 891107
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.