Components.Exception
is a JavaScript constructor to create nsIXPCException objects. These exception objects may be thrown when implementing xpcom interfaces in JavaScript, and they can provide better diagnostics in the error console if not caught than simply throwing an nsresult
's value will.
See also nsIXPCException
.
var exception = [ new ] Components.Exception([ message [, result [, stack [, data ] ] ] ]);
message
result
nsresult
value of the exception, which defaults to Components.results.NS_ERROR_FAILURE
stack
data
null
throw Components.Exception("I am throwing an Exception from a Javascript XPCOM component.");