michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: * michael@0: * The origin of this IDL file is michael@0: * http://dom.spec.whatwg.org/#exception-domexception michael@0: * michael@0: * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C michael@0: * liability, trademark and document use rules apply. michael@0: */ michael@0: michael@0: michael@0: // This is the WebIDL version of nsIException. This is mostly legacy stuff. michael@0: michael@0: interface StackFrame; michael@0: michael@0: [NoInterfaceObject] michael@0: interface ExceptionMembers michael@0: { michael@0: // A custom message set by the thrower. michael@0: readonly attribute DOMString message; michael@0: // The nsresult associated with this exception. michael@0: readonly attribute unsigned long result; michael@0: // The name of the error code (ie, a string repr of |result|) michael@0: readonly attribute DOMString name; michael@0: michael@0: // Filename location. This is the location that caused the michael@0: // error, which may or may not be a source file location. michael@0: // For example, standard language errors would generally have michael@0: // the same location as their top stack entry. File michael@0: // parsers may put the location of the file they were parsing, michael@0: // etc. michael@0: michael@0: // null indicates "no data" michael@0: readonly attribute DOMString filename; michael@0: // Valid line numbers begin at '1'. '0' indicates unknown. michael@0: readonly attribute unsigned long lineNumber; michael@0: // Valid column numbers begin at 0. michael@0: // We don't have an unambiguous indicator for unknown. michael@0: readonly attribute unsigned long columnNumber; michael@0: michael@0: // A stack trace, if available. nsIStackFrame does not have classinfo so michael@0: // this was only ever usefully available to chrome JS. michael@0: [ChromeOnly] michael@0: readonly attribute StackFrame? location; michael@0: // An inner exception that triggered this, if available. michael@0: readonly attribute nsISupports? inner; michael@0: michael@0: // Arbitary data for the implementation. michael@0: readonly attribute nsISupports? data; michael@0: michael@0: // A generic formatter - make it suitable to print, etc. michael@0: stringifier; michael@0: }; michael@0: michael@0: [NoInterfaceObject] michael@0: interface Exception { michael@0: }; michael@0: michael@0: Exception implements ExceptionMembers; michael@0: michael@0: // XXXkhuey this is an 'exception', not an interface, but we don't have any michael@0: // parser or codegen mechanisms for dealing with exceptions. michael@0: interface DOMException { michael@0: const unsigned short INDEX_SIZE_ERR = 1; michael@0: const unsigned short DOMSTRING_SIZE_ERR = 2; // historical michael@0: const unsigned short HIERARCHY_REQUEST_ERR = 3; michael@0: const unsigned short WRONG_DOCUMENT_ERR = 4; michael@0: const unsigned short INVALID_CHARACTER_ERR = 5; michael@0: const unsigned short NO_DATA_ALLOWED_ERR = 6; // historical michael@0: const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7; michael@0: const unsigned short NOT_FOUND_ERR = 8; michael@0: const unsigned short NOT_SUPPORTED_ERR = 9; michael@0: const unsigned short INUSE_ATTRIBUTE_ERR = 10; // historical michael@0: const unsigned short INVALID_STATE_ERR = 11; michael@0: const unsigned short SYNTAX_ERR = 12; michael@0: const unsigned short INVALID_MODIFICATION_ERR = 13; michael@0: const unsigned short NAMESPACE_ERR = 14; michael@0: const unsigned short INVALID_ACCESS_ERR = 15; michael@0: const unsigned short VALIDATION_ERR = 16; // historical michael@0: const unsigned short TYPE_MISMATCH_ERR = 17; // historical; use JavaScript's TypeError instead michael@0: const unsigned short SECURITY_ERR = 18; michael@0: const unsigned short NETWORK_ERR = 19; michael@0: const unsigned short ABORT_ERR = 20; michael@0: const unsigned short URL_MISMATCH_ERR = 21; michael@0: const unsigned short QUOTA_EXCEEDED_ERR = 22; michael@0: const unsigned short TIMEOUT_ERR = 23; michael@0: const unsigned short INVALID_NODE_TYPE_ERR = 24; michael@0: const unsigned short DATA_CLONE_ERR = 25; michael@0: michael@0: readonly attribute unsigned short code; michael@0: }; michael@0: michael@0: // XXXkhuey copy all of Gecko's non-standard stuff onto DOMException, but leave michael@0: // the prototype chain sane. michael@0: DOMException implements ExceptionMembers;