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 ] ] ] ]);
messageresult nsresult value of the exception, which defaults to Components.results.NS_ERROR_FAILUREstack data nullthrow Components.Exception("I am throwing an Exception from a Javascript XPCOM component.");