Closed Bug 116072 Opened 24 years ago Closed 9 years ago

Access to additional properties on an nsXPCException may be needed

Categories

(Core :: XPConnect, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME
mozilla1.7alpha

People

(Reporter: dbradley, Assigned: dbradley)

Details

Robert Clary brought this issue up. What is in question is should additional nsXPCException properties be exposed. Currently you are able to enumerate the properties, but accessing some, filename, line number, and a few others are prohibited by security. Some discussion on this occured in bug 58538. The following is information provided by Robert Clary: I have been having a problem in http://developer.netscape.com/evangelism/tools/testsuites/ on post 0.9.4 Mozilla builds on one particular test case. tc_celm508. It turns out that the during an exception handler where I am enumerating the properties of an exception I get permission denied errors for the filename, lineNumber, columnNumber of the exception. It appears to be indicating that the exception (XPCWrappedNative_NoHelper - http://lxr.mozilla.org/seamonkey/source/js/src/xpconnect/src/xpcwrappednativejsops.cpp#709) does not allow me access to these properties even though they are enumerable. The test cases are all located in http://developer.netscape.com/evangelism/tools/testsuites/w3c-dom-core-2/. The particular test case is http://developer.netscape.com/evangelism/tools/testsuites/w3c-dom-core-2/tc_celm508.js. This test case is primarily testing DOM Namespace related issues. It intentionally does things which will/should cause exceptions. The test frame itself is a horribly overcomplicated POS, but you can find it at: http://developer.netscape.com/evangelism/lib/js/xbTestFrame/ The location of the actual error occurs in the xbException.init method found in http://developer.netscape.com/evangelism/lib/js/xbObjects.js. Exception [string] "Permission denied to get property UnknownClass.filename" thrown from function init(errorMessage= string:"Caught Exception", errorFile=string:"", errorFunction=string: "", exception=XPComponent: {0}) in < http://developer. netscape.com/evangelism/ lib/js/xbObjects.js <http://developer.netscape.com/evangelism/lib/js/xbObjects.js> > line 194. Stopped for thrown exception. exception.toString() $[1] = [string] "[Exception... \"Not enough arguments [nsIDOMNamedNodeMap. removeNamedItemNS]\" nsresult: \"0x80570001 (NS_ERROR_XPC_NOT_ ENOUGH_ARGS)\" location: \"JS frame :: http://developer. netscape.com/evangelism/ lib/js/xbTestFrame/ xbTestFrame.js <http://developer.netscape.com/evangelism/lib/js/xbTestFrame/xbTestFrame.js> :: testEx :: line 241\" data: no]"
Note: this was also requested of JS Engine; see bug 50447 "JS Exceptions should have filename/linenumber properties"
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.1
retargetting to post 1.0 mozilla again
Retargetting to the proper post 1.0 milestone (really this time)
Target Milestone: mozilla1.1 → mozilla1.2
This should be pretty easy to do.
Moving out to 1.3. If this needs to be in before 1.3 please comment.
Target Milestone: mozilla1.2alpha → mozilla1.3alpha
Moving to 1.4 Alpha
Target Milestone: mozilla1.3alpha → mozilla1.4alpha
Moving out
Target Milestone: mozilla1.4alpha → mozilla1.5alpha
Moving out
Target Milestone: mozilla1.5alpha → mozilla1.6alpha
Moving out
Target Milestone: mozilla1.6alpha → mozilla1.7alpha
QA Contact: pschwartau → xpconnect
nsXPCException is just a collection of static methods now. If more modern exception representations need more properties, we can file bugs on them.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.