Closed
Bug 44050
Opened 25 years ago
Closed 24 years ago
need error architecture (names and messages)
Categories
(Core :: XPCOM, defect, P3)
Core
XPCOM
Tracking
()
mozilla1.0
People
(Reporter: warrensomebody, Assigned: mike+mozilla)
References
Details
(Keywords: arch)
We need an architecture in xpcom to allow error constant names and error message
strings to be supplied. Error constant names are necessary for js, so that you
can say
catch (e) {
if (e == FILE_NOT_FOUND)
...
}
}
instead of:
catch (e) {
if (e == 0x80045032)
...
}
}
Error message strings (or string bundles) need to be coughed up so that once an
error is returned by a component, the caller can go back to that component to
ask for a message to format to the user. (This part is probably related to
having nsINotification, bug 40729.)
We may also want a way for a component to be able to say "I return errors in
this range" so that we can map from error numbers back to the components that
defined them.
Reporter | ||
Comment 1•25 years ago
|
||
Forgot to mention that there should be an interface that accesses this error
info (nsIErrorInfo), and we should probably obtain that interface by asking the
component's factory to construct a well-known CID, or by QI'ing the factory to
nsIErrorInfo.
Keywords: arch
Updated•25 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → M20
Reporter | ||
Comment 2•24 years ago
|
||
I added nsIErrorService to xpcom -- until mccabe fixes bug 13423. We'll still
need some sort of interface to access these error names from c++ though, once
that comes along.
Depends on: 13423
Reporter | ||
Comment 3•24 years ago
|
||
Assigning rest of xpcom stuff to myself (from Ray).
Assignee: rayw → warren
Status: ASSIGNED → NEW
Target Milestone: M20 → mozilla1.0
Reporter | ||
Comment 4•24 years ago
|
||
So when I added code to necko to use the nsIErrorService
(http://lxr.mozilla.org/seamonkey/source/netwerk/base/src/nsIOService.cpp#74), I
chose error key names like "ResolvingHost" and "ConnectedTo" (see
netwerk/resources/locale/en-US/necko.properties). However, I should have chosen
name like "nsIFileTransportService.NS_NET_STATUS_READ_FROM" and
"nsISocketTransportService.NS_NET_STATUS_CONNECTED_TO" -- the names that will
finally be used when McCabe implements the error stuff for xpidl. This means
that when his changes come along, the keys in necko.properties will have to be
changed (as well as ripping out the work-around that explicitly registers the
keys in nsIOService.cpp).
Reassigning to mccabe.
Assignee: warren → mccabe
Assignee | ||
Comment 5•24 years ago
|
||
*** This bug has been marked as a duplicate of 13423 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Comment 6•24 years ago
|
||
You can do this now . . . It is all part of the Components.Exception object.
catch (e) {
if (e.name == "FILE_NOT_FOUND")
...
}
}
You need to log in
before you can comment on or make changes to this bug.
Description
•