1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/base/nsIException.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,64 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/* 1.10 + * Interfaces for representing cross-language exceptions and stack traces. 1.11 + */ 1.12 + 1.13 + 1.14 +#include "nsISupports.idl" 1.15 + 1.16 +[scriptable, uuid(3bc4793f-e6be-44d6-b839-d6b9e85e5346)] 1.17 +interface nsIStackFrame : nsISupports 1.18 +{ 1.19 + // see nsIProgrammingLanguage for list of language consts 1.20 + readonly attribute uint32_t language; 1.21 + readonly attribute AUTF8String languageName; 1.22 + readonly attribute AString filename; 1.23 + readonly attribute AString name; 1.24 + // Valid line numbers begin at '1'. '0' indicates unknown. 1.25 + readonly attribute int32_t lineNumber; 1.26 + readonly attribute AUTF8String sourceLine; 1.27 + readonly attribute nsIStackFrame caller; 1.28 + 1.29 + AUTF8String toString(); 1.30 +}; 1.31 + 1.32 +[scriptable, uuid(1caf1461-be1d-4b79-a552-5292b6bf3c35)] 1.33 +interface nsIException : nsISupports 1.34 +{ 1.35 + // A custom message set by the thrower. 1.36 + [binaryname(MessageMoz)] readonly attribute AUTF8String message; 1.37 + // The nsresult associated with this exception. 1.38 + readonly attribute nsresult result; 1.39 + // The name of the error code (ie, a string repr of |result|) 1.40 + readonly attribute AUTF8String name; 1.41 + 1.42 + // Filename location. This is the location that caused the 1.43 + // error, which may or may not be a source file location. 1.44 + // For example, standard language errors would generally have 1.45 + // the same location as their top stack entry. File 1.46 + // parsers may put the location of the file they were parsing, 1.47 + // etc. 1.48 + 1.49 + // null indicates "no data" 1.50 + readonly attribute AString filename; 1.51 + // Valid line numbers begin at '1'. '0' indicates unknown. 1.52 + readonly attribute uint32_t lineNumber; 1.53 + // Valid column numbers begin at 0. 1.54 + // We don't have an unambiguous indicator for unknown. 1.55 + readonly attribute uint32_t columnNumber; 1.56 + 1.57 + // A stack trace, if available. 1.58 + readonly attribute nsIStackFrame location; 1.59 + // An inner exception that triggered this, if available. 1.60 + readonly attribute nsIException inner; 1.61 + 1.62 + // Arbitary data for the implementation. 1.63 + readonly attribute nsISupports data; 1.64 + 1.65 + // A generic formatter - make it suitable to print, etc. 1.66 + AUTF8String toString(); 1.67 +};