# To add error code to your module, you need to do the following: # # 1) Add a module offset code. Add yours to the bottom of the list # right below this comment, adding 1. # # 2) In your module, define a header file which uses one of the # NE_ERROR_GENERATExxxxxx macros. Some examples below: # # #define NS_ERROR_MYMODULE_MYERROR1 \ # NS_ERROR_GENERATE(NS_ERROR_SEVERITY_ERROR,NS_ERROR_MODULE_MYMODULE,1) # #define NS_ERROR_MYMODULE_MYERROR2 NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_MYMODULE,2) # #define NS_ERROR_MYMODULE_MYERROR3 NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_MYMODULE,3)
# @name Standard Module Offset Code. Each Module should identify a unique number # and then all errors associated with that module become offsets from the # base associated with that module id. There are 16 bits of code bits for # each module.
modules["XPCOM"] = Mod(1)
modules["BASE"] = Mod(2)
modules["GFX"] = Mod(3)
modules["WIDGET"] = Mod(4)
modules["CALENDAR"] = Mod(5)
modules["NETWORK"] = Mod(6)
modules["PLUGINS"] = Mod(7)
modules["LAYOUT"] = Mod(8)
modules["HTMLPARSER"] = Mod(9)
modules["RDF"] = Mod(10)
modules["UCONV"] = Mod(11)
modules["REG"] = Mod(12)
modules["FILES"] = Mod(13)
modules["DOM"] = Mod(14)
modules["IMGLIB"] = Mod(15)
modules["MAILNEWS"] = Mod(16)
modules["EDITOR"] = Mod(17)
modules["XPCONNECT"] = Mod(18)
modules["PROFILE"] = Mod(19)
modules["LDAP"] = Mod(20)
modules["SECURITY"] = Mod(21)
modules["DOM_XPATH"] = Mod(22) # Mod(23) used to be NS_ERROR_MODULE_DOM_RANGE (see bug 711047)
modules["URILOADER"] = Mod(24)
modules["CONTENT"] = Mod(25)
modules["PYXPCOM"] = Mod(26)
modules["XSLT"] = Mod(27)
modules["IPC"] = Mod(28)
modules["SVG"] = Mod(29)
modules["STORAGE"] = Mod(30)
modules["SCHEMA"] = Mod(31)
modules["DOM_FILE"] = Mod(32)
modules["DOM_INDEXEDDB"] = Mod(33)
modules["DOM_FILEHANDLE"] = Mod(34)
modules["SIGNED_JAR"] = Mod(35)
modules["DOM_FILESYSTEM"] = Mod(36)
modules["DOM_BLUETOOTH"] = Mod(37)
modules["SIGNED_APP"] = Mod(38)
modules["DOM_ANIM"] = Mod(39)
modules["DOM_PUSH"] = Mod(40)
modules["DOM_MEDIA"] = Mod(41)
modules["URL_CLASSIFIER"] = Mod(42) # ErrorResult gets its own module to reduce the chance of someone accidentally # defining an error code matching one of the ErrorResult ones.
modules["ERRORRESULT"] = Mod(43) # Win32 system error codes, which are not mapped to a specific other value, # see Bug 1686041.
modules["WIN32"] = Mod(44)
modules["WDBA"] = Mod(45)
# NS_ERROR_MODULE_GENERAL should be used by modules that do not # care if return code values overlap. Callers of methods that # return such codes should be aware that they are not # globally unique. Implementors should be careful about blindly # returning codes from other modules that might also use # the generic base.
modules["GENERAL"] = Mod(51)
# Errors is an ordered dictionary, so that we can recover the order in which # they were defined. This is important for determining which name is the # canonical name for an error code.
errors = OrderedDict()
# Standard "it worked" return value
errors["NS_OK"] = 0
# ======================================================================= # Core errors, not part of any modules # =======================================================================
errors["NS_ERROR_BASE"] = 0xC1F30000 # Returned when an instance is not initialized
errors["NS_ERROR_NOT_INITIALIZED"] = errors["NS_ERROR_BASE"] + 1 # Returned when an instance is already initialized
errors["NS_ERROR_ALREADY_INITIALIZED"] = errors["NS_ERROR_BASE"] + 2 # Returned by a not implemented function
errors["NS_ERROR_NOT_IMPLEMENTED"] = 0x80004001 # Returned when a given interface is not supported.
errors["NS_NOINTERFACE"] = 0x80004002
errors["NS_ERROR_NO_INTERFACE"] = errors["NS_NOINTERFACE"] # Returned when a function aborts
errors["NS_ERROR_ABORT"] = 0x80004004 # Returned when a function fails
errors["NS_ERROR_FAILURE"] = 0x80004005 # Returned when an unexpected error occurs
errors["NS_ERROR_UNEXPECTED"] = 0x8000FFFF # Returned when a memory allocation fails
errors["NS_ERROR_OUT_OF_MEMORY"] = 0x8007000E # Returned when an illegal value is passed
errors["NS_ERROR_ILLEGAL_VALUE"] = 0x80070057
errors["NS_ERROR_INVALID_ARG"] = errors["NS_ERROR_ILLEGAL_VALUE"]
errors["NS_ERROR_INVALID_POINTER"] = errors["NS_ERROR_INVALID_ARG"]
errors["NS_ERROR_NULL_POINTER"] = errors["NS_ERROR_INVALID_ARG"] # Returned when an operation can't complete due to an unavailable resource
errors["NS_ERROR_NOT_AVAILABLE"] = 0x80040111 # Returned when a class is not registered
errors["NS_ERROR_FACTORY_NOT_REGISTERED"] = 0x80040154 # Returned when a class cannot be registered, but may be tried again later
errors["NS_ERROR_FACTORY_REGISTER_AGAIN"] = 0x80040155 # Returned when a dynamically loaded factory couldn't be found
errors["NS_ERROR_FACTORY_NOT_LOADED"] = 0x800401F8 # Returned when a factory doesn't support signatures
errors["NS_ERROR_FACTORY_NO_SIGNATURE_SUPPORT"] = errors["NS_ERROR_BASE"] + 0x101 # Returned when a factory already is registered
errors["NS_ERROR_FACTORY_EXISTS"] = errors["NS_ERROR_BASE"] + 0x100
# ======================================================================= # 1: NS_ERROR_MODULE_XPCOM # ======================================================================= with modules["XPCOM"]: # Result codes used by nsIVariant
errors["NS_ERROR_CANNOT_CONVERT_DATA"] = FAILURE(1)
errors["NS_ERROR_OBJECT_IS_IMMUTABLE"] = FAILURE(2)
errors["NS_ERROR_LOSS_OF_SIGNIFICANT_DATA"] = FAILURE(3) # Result code used by nsIThreadManager
errors["NS_ERROR_NOT_SAME_THREAD"] = FAILURE(4) # Various operations are not permitted during XPCOM shutdown and will fail # with this exception.
errors["NS_ERROR_ILLEGAL_DURING_SHUTDOWN"] = FAILURE(30)
errors["NS_ERROR_SERVICE_NOT_AVAILABLE"] = FAILURE(22) # nsAppRunner fatal errors
errors["NS_ERROR_OMNIJAR_CORRUPT"] = FAILURE(40)
errors["NS_ERROR_OMNIJAR_OR_DIR_MISSING"] = FAILURE(41)
errors["NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA"] = SUCCESS(1) # Used by nsCycleCollectionParticipant
errors["NS_SUCCESS_INTERRUPTED_TRAVERSE"] = SUCCESS(2)
# Stream closed
errors["NS_BASE_STREAM_CLOSED"] = FAILURE(2) # Error from the operating system
errors["NS_BASE_STREAM_OSERROR"] = FAILURE(3) # Illegal arguments
errors["NS_BASE_STREAM_ILLEGAL_ARGS"] = FAILURE(4) # For unichar streams
errors["NS_BASE_STREAM_NO_CONVERTER"] = FAILURE(5) # For unichar streams
errors["NS_BASE_STREAM_BAD_CONVERSION"] = FAILURE(6)
errors["NS_BASE_STREAM_WOULD_BLOCK"] = FAILURE(7)
# ======================================================================= # 3: NS_ERROR_MODULE_GFX # ======================================================================= with modules["GFX"]: # no printer available (e.g. cannot find _any_ printer)
errors["NS_ERROR_GFX_PRINTER_NO_PRINTER_AVAILABLE"] = FAILURE(1) # _specified_ (by name) printer not found
errors["NS_ERROR_GFX_PRINTER_NAME_NOT_FOUND"] = FAILURE(2) # print-to-file: could not open output file
errors["NS_ERROR_GFX_PRINTER_COULD_NOT_OPEN_FILE"] = FAILURE(3) # print: starting document
errors["NS_ERROR_GFX_PRINTER_STARTDOC"] = FAILURE(4) # print: ending document
errors["NS_ERROR_GFX_PRINTER_ENDDOC"] = FAILURE(5) # print: starting page
errors["NS_ERROR_GFX_PRINTER_STARTPAGE"] = FAILURE(6) # The document is still being loaded
errors["NS_ERROR_GFX_PRINTER_DOC_IS_BUSY"] = FAILURE(7)
# Font cmap is strangely structured - avoid this font!
errors["NS_ERROR_GFX_CMAP_MALFORMED"] = FAILURE(51)
# ======================================================================= # 4: NS_ERROR_MODULE_WIDGET # ======================================================================= with modules["WIDGET"]: # Used by: # - nsIWidget::NotifyIME() # Returned when the notification or the event is handled and it's consumed # by somebody.
errors["NS_SUCCESS_EVENT_CONSUMED"] = SUCCESS(1)
# ======================================================================= # 6: NS_ERROR_MODULE_NETWORK # ======================================================================= with modules["NETWORK"]: # General async request error codes: # # These error codes are commonly passed through callback methods to indicate # the status of some requested async request. # # For example, see nsIRequestObserver::onStopRequest.
# The async request completed successfully.
errors["NS_BINDING_SUCCEEDED"] = errors["NS_OK"]
# The async request failed for some unknown reason.
errors["NS_BINDING_FAILED"] = FAILURE(1) # The async request failed because it was aborted by some user action.
errors["NS_BINDING_ABORTED"] = FAILURE(2) # The async request has been "redirected" to a different async request. # (e.g., an HTTP redirect occurred). # # This error code is used with load groups to notify the load group observer # when a request in the load group is redirected to another request.
errors["NS_BINDING_REDIRECTED"] = FAILURE(3) # The async request has been "retargeted" to a different "handler." # # This error code is used with load groups to notify the load group observer # when a request in the load group is removed from the load group and added # to a different load group.
errors["NS_BINDING_RETARGETED"] = FAILURE(4)
# Miscellaneous error codes: These errors are not typically passed via # onStopRequest.
# The URI is malformed.
errors["NS_ERROR_MALFORMED_URI"] = FAILURE(10) # The requested action could not be completed while the object is busy. # Implementations of nsIChannel::asyncOpen will commonly return this error # if the channel has already been opened (and has not yet been closed).
errors["NS_ERROR_IN_PROGRESS"] = FAILURE(15) # Returned from nsIChannel::asyncOpen to indicate that OnDataAvailable will # not be called because there is no content available. This is used by # helper app style protocols (e.g., mailto). XXX perhaps this should be a # success code.
errors["NS_ERROR_NO_CONTENT"] = FAILURE(17) # The URI scheme corresponds to an unknown protocol handler.
errors["NS_ERROR_UNKNOWN_PROTOCOL"] = FAILURE(18) # The content encoding of the source document was incorrect, for example # returning a plain HTML document advertised as Content-Encoding: gzip
errors["NS_ERROR_INVALID_CONTENT_ENCODING"] = FAILURE(27) # A transport level corruption was found in the source document. for example # a document with a calculated checksum that does not match the Content-MD5 # http header.
errors["NS_ERROR_CORRUPTED_CONTENT"] = FAILURE(29) # A content signature verification failed for some reason. This can be either # an actual verification error, or any other error that led to the fact that # a content signature that was expected couldn't be verified.
errors["NS_ERROR_INVALID_SIGNATURE"] = FAILURE(58) # While parsing for the first component of a header field using syntax as in # Content-Disposition or Content-Type, the first component was found to be # empty, such as in: Content-Disposition: ; filename=foo
errors["NS_ERROR_FIRST_HEADER_FIELD_COMPONENT_EMPTY"] = FAILURE(34) # Returned from nsIChannel::asyncOpen when trying to open the channel again # (reopening is not supported).
errors["NS_ERROR_ALREADY_OPENED"] = FAILURE(73)
# Connectivity error codes:
# The connection is already established. XXX unused - consider removing.
errors["NS_ERROR_ALREADY_CONNECTED"] = FAILURE(11) # The connection does not exist. XXX unused - consider removing.
errors["NS_ERROR_NOT_CONNECTED"] = FAILURE(12) # The connection attempt failed, for example, because no server was # listening at specified host:port.
errors["NS_ERROR_CONNECTION_REFUSED"] = FAILURE(13) # The connection was lost due to a timeout error.
errors["NS_ERROR_NET_TIMEOUT"] = FAILURE(14) # The requested action could not be completed while the networking library # is in the offline state.
errors["NS_ERROR_OFFLINE"] = FAILURE(16) # The requested action was prohibited because it would have caused the # networking library to establish a connection to an unsafe or otherwise # banned port.
errors["NS_ERROR_PORT_ACCESS_NOT_ALLOWED"] = FAILURE(19) # The connection was established, but no data was ever received.
errors["NS_ERROR_NET_RESET"] = FAILURE(20) # The connection was established, but browser received an error response from the server
errors["NS_ERROR_NET_ERROR_RESPONSE"] = FAILURE(35) # The connection was established, but browser received an empty page with 4xx, 5xx error response
errors["NS_ERROR_NET_EMPTY_RESPONSE"] = FAILURE(36) # The connection was established, but the data transfer was interrupted.
errors["NS_ERROR_NET_INTERRUPT"] = FAILURE(71) # The connection attempt to a proxy failed.
errors["NS_ERROR_PROXY_CONNECTION_REFUSED"] = FAILURE(72) # A transfer was only partially done when it completed.
errors["NS_ERROR_NET_PARTIAL_TRANSFER"] = FAILURE(76) # HTTP/2 detected invalid TLS configuration
errors["NS_ERROR_NET_INADEQUATE_SECURITY"] = FAILURE(82) # HTTP/2 sent a GOAWAY
errors["NS_ERROR_NET_HTTP2_SENT_GOAWAY"] = FAILURE(83) # HTTP/3 protocol internal error
errors["NS_ERROR_NET_HTTP3_PROTOCOL_ERROR"] = FAILURE(84) # A timeout error code that can be used to cancel requests.
errors["NS_ERROR_NET_TIMEOUT_EXTERNAL"] = FAILURE(85) # An error related to HTTPS-only mode
errors["NS_ERROR_HTTPS_ONLY"] = FAILURE(86) # A WebSocket connection is failed.
errors["NS_ERROR_WEBSOCKET_CONNECTION_REFUSED"] = FAILURE(87) # A connection to a non local address is refused because # xpc::AreNonLocalConnectionsDisabled() returns true.
errors["NS_ERROR_NON_LOCAL_CONNECTION_REFUSED"] = FAILURE(88) # Connection to a sts host without a hsts header.
errors["NS_ERROR_BAD_HSTS_CERT"] = FAILURE(89) # Error parsing the status line of an HTTP response
errors["NS_ERROR_PARSING_HTTP_STATUS_LINE"] = FAILURE(90) # The user refused to navigate to a potentially unsafe URL with # embedded credentials/superfluos authentication.
errors["NS_ERROR_SUPERFLUOS_AUTH"] = FAILURE(91) # The user attempted basic HTTP authentication while # the basic_http_auth pref is disabled
errors["NS_ERROR_BASIC_HTTP_AUTH_DISABLED"] = FAILURE(92)
# XXX really need to better rationalize these error codes. are consumers of # necko really expected to know how to discern the meaning of these?? # This request is not resumable, but it was tried to resume it, or to # request resume-specific data.
errors["NS_ERROR_NOT_RESUMABLE"] = FAILURE(25) # The request failed as a result of a detected redirection loop.
errors["NS_ERROR_REDIRECT_LOOP"] = FAILURE(31) # It was attempted to resume the request, but the entity has changed in the # meantime.
errors["NS_ERROR_ENTITY_CHANGED"] = FAILURE(32) # The request failed because the content type returned by the server was not # a type expected by the channel (for nested channels such as the JAR # channel).
errors["NS_ERROR_UNSAFE_CONTENT_TYPE"] = FAILURE(74) # The request resulted in an error page being displayed.
errors["NS_ERROR_LOAD_SHOWED_ERRORPAGE"] = FAILURE(77) # The request occurred in docshell that lacks a treeowner, so it is # probably in the process of being torn down.
errors["NS_ERROR_DOCSHELL_DYING"] = FAILURE(78)
# DNS specific error codes:
# The lookup of a hostname failed. This generally refers to the hostname # from the URL being loaded.
errors["NS_ERROR_UNKNOWN_HOST"] = FAILURE(30) # A low or medium priority DNS lookup failed because the pending queue was # already full. High priorty (the default) always makes room
errors["NS_ERROR_DNS_LOOKUP_QUEUE_FULL"] = FAILURE(33) # The lookup of a proxy hostname failed. If a channel is configured to # speak to a proxy server, then it will generate this error if the proxy # hostname cannot be resolved.
errors["NS_ERROR_UNKNOWN_PROXY_HOST"] = FAILURE(42) # This DNS error will occur when the resolver uses the Extended DNS Error # option to indicate an error code for which we should not fall back to the # default DNS resolver. This means the DNS failure is definitive.
errors["NS_ERROR_DEFINITIVE_UNKNOWN_HOST"] = FAILURE(43)
# Socket specific error codes:
# The specified socket type does not exist.
errors["NS_ERROR_UNKNOWN_SOCKET_TYPE"] = FAILURE(51) # The specified socket type could not be created.
errors["NS_ERROR_SOCKET_CREATE_FAILED"] = FAILURE(52) # The operating system doesn't support the given type of address.
errors["NS_ERROR_SOCKET_ADDRESS_NOT_SUPPORTED"] = FAILURE(53) # The address to which we tried to bind the socket was busy.
errors["NS_ERROR_SOCKET_ADDRESS_IN_USE"] = FAILURE(54)
# Cache specific error codes:
errors["NS_ERROR_CACHE_KEY_NOT_FOUND"] = FAILURE(61)
errors["NS_ERROR_CACHE_DATA_IS_STREAM"] = FAILURE(62)
errors["NS_ERROR_CACHE_DATA_IS_NOT_STREAM"] = FAILURE(63)
errors["NS_ERROR_CACHE_WAIT_FOR_VALIDATION"] = FAILURE(64)
errors["NS_ERROR_CACHE_ENTRY_DOOMED"] = FAILURE(65)
errors["NS_ERROR_CACHE_READ_ACCESS_DENIED"] = FAILURE(66)
errors["NS_ERROR_CACHE_WRITE_ACCESS_DENIED"] = FAILURE(67)
errors["NS_ERROR_CACHE_IN_USE"] = FAILURE(68) # Error passed through onStopRequest if the document could not be fetched # from the cache.
errors["NS_ERROR_DOCUMENT_NOT_CACHED"] = FAILURE(70)
# Effective TLD Service specific error codes:
# The requested number of domain levels exceeds those present in the host # string.
errors["NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS"] = FAILURE(80) # The host string is an IP address.
errors["NS_ERROR_HOST_IS_IP_ADDRESS"] = FAILURE(81)
# StreamLoader specific result codes:
# Result code returned by nsIStreamLoaderObserver to indicate that the # observer is taking over responsibility for the data buffer, and the loader # should NOT free it.
errors["NS_SUCCESS_ADOPTED_DATA"] = SUCCESS(90)
# This success code may be returned by nsIAuthModule::getNextToken to # indicate that the authentication is finished and thus there's no need # to call getNextToken again.
errors["NS_SUCCESS_AUTH_FINISHED"] = SUCCESS(40)
# These are really not "results", they're statuses, used by nsITransport and # friends. This is abuse of nsresult, but we'll put up with it for now. # nsITransport
errors["NS_NET_STATUS_READING"] = SUCCESS(8)
errors["NS_NET_STATUS_WRITING"] = SUCCESS(9)
# nsIInterceptedChannel # Generic error for non-specific failures during service worker interception
errors["NS_ERROR_INTERCEPTION_FAILED"] = FAILURE(100)
# ======================================================================= # 10: NS_ERROR_MODULE_RDF # ======================================================================= with modules["RDF"]: # Returned from nsIRDFDataSource::Assert() and Unassert() if the assertion # (or unassertion was accepted by the datasource
errors["NS_RDF_ASSERTION_ACCEPTED"] = errors["NS_OK"] # Returned from nsIRDFDataSource::GetSource() and GetTarget() if the # source/target has no value
errors["NS_RDF_NO_VALUE"] = SUCCESS(2) # Returned from nsIRDFDataSource::Assert() and Unassert() if the assertion # (or unassertion) was rejected by the datasource; i.e., the datasource was # not willing to record the statement.
errors["NS_RDF_ASSERTION_REJECTED"] = SUCCESS(3) # Return this from rdfITripleVisitor to stop cycling
errors["NS_RDF_STOP_VISIT"] = SUCCESS(4)
errors["NS_SUCCESS_FILE_DIRECTORY_EMPTY"] = SUCCESS(1) # Result codes used by nsIDirectoryServiceProvider2
errors["NS_SUCCESS_AGGREGATE_RESULT"] = SUCCESS(2)
# ======================================================================= # 14: NS_ERROR_MODULE_DOM # ======================================================================= with modules["DOM"]: # XXX If you add a new DOM error code, also add an error string to # dom/base/domerr.msg
# When manipulating the bytecode cache with the JS API, some transcoding # errors, such as a different bytecode format can cause failures of the # decoding process.
errors["NS_ERROR_DOM_JS_DECODING_ERROR"] = FAILURE(1026)
# Used to indicate that a URI may not be loaded into a cross-origin # context.
errors["NS_ERROR_DOM_BAD_CROSS_ORIGIN_URI"] = FAILURE(1037)
# The request failed because there are too many recursive iframes or # objects being loaded.
errors["NS_ERROR_RECURSIVE_DOCUMENT_LOAD"] = FAILURE(1038)
# WebExtension content script may not load this URL.
errors["NS_ERROR_DOM_WEBEXT_CONTENT_SCRIPT_URI"] = FAILURE(1039)
# Used to indicate that a resource load was blocked because of the # Cross-Origin-Embedder-Policy response header. # https://html.spec.whatwg.org/multipage/origin.html#coep
errors["NS_ERROR_DOM_COEP_FAILED"] = FAILURE(1040)
# May be used to indicate when e.g. setting a property value didn't # actually change the value, like for obj.foo = "bar"; obj.foo = "bar"; # the second assignment throws NS_SUCCESS_DOM_NO_OPERATION.
errors["NS_SUCCESS_DOM_NO_OPERATION"] = SUCCESS(1)
# A success code that indicates that evaluating a string of JS went # just fine except it threw an exception. Only for legacy use by # nsJSUtils.
errors["NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW"] = SUCCESS(2)
# A success code that indicates that evaluating a string of JS went # just fine except it was killed by an uncatchable exception. # Only for legacy use by nsJSUtils.
errors["NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW_UNCATCHABLE"] = SUCCESS(3)
# An error code that indicates that the DOM tree has been modified by # web app or add-on while the editor modifying the tree. However, # this shouldn't be exposed to the web because the result should've # been expected by the web app.
errors["NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE"] = FAILURE(2)
# An error code that indicates that the edit action canceled by # clipboard event listener or beforeinput event listener. Note that # don't make this as a success code since it's not check with NS_FAILED() # and may keep handling the operation unexpectedly.
errors["NS_ERROR_EDITOR_ACTION_CANCELED"] = FAILURE(3)
# An error code that indicates that there is no editable selection ranges. # E.g., Selection has no range, caret is in non-editable element, # non-collapsed range crosses editing host boundaries.
errors["NS_ERROR_EDITOR_NO_EDITABLE_RANGE"] = FAILURE(4)
# CMS specific nsresult error codes. Note: the numbers used here correspond # to the values in nsICMSMessageErrors.idl.
errors["NS_ERROR_CMS_VERIFY_NOT_SIGNED"] = FAILURE(1024)
errors["NS_ERROR_CMS_VERIFY_NO_CONTENT_INFO"] = FAILURE(1025)
errors["NS_ERROR_CMS_VERIFY_BAD_DIGEST"] = FAILURE(1026)
errors["NS_ERROR_CMS_VERIFY_NOCERT"] = FAILURE(1028)
errors["NS_ERROR_CMS_VERIFY_UNTRUSTED"] = FAILURE(1029)
errors["NS_ERROR_CMS_VERIFY_ERROR_UNVERIFIED"] = FAILURE(1031)
errors["NS_ERROR_CMS_VERIFY_ERROR_PROCESSING"] = FAILURE(1032)
errors["NS_ERROR_CMS_VERIFY_BAD_SIGNATURE"] = FAILURE(1033)
errors["NS_ERROR_CMS_VERIFY_DIGEST_MISMATCH"] = FAILURE(1034)
errors["NS_ERROR_CMS_VERIFY_UNKNOWN_ALGO"] = FAILURE(1035)
errors["NS_ERROR_CMS_VERIFY_UNSUPPORTED_ALGO"] = FAILURE(1036)
errors["NS_ERROR_CMS_VERIFY_MALFORMED_SIGNATURE"] = FAILURE(1037)
errors["NS_ERROR_CMS_VERIFY_HEADER_MISMATCH"] = FAILURE(1038)
errors["NS_ERROR_CMS_VERIFY_NOT_YET_ATTEMPTED"] = FAILURE(1039)
errors["NS_ERROR_CMS_VERIFY_CERT_WITHOUT_ADDRESS"] = FAILURE(1040)
errors["NS_ERROR_CMS_ENCRYPT_NO_BULK_ALG"] = FAILURE(1056)
errors["NS_ERROR_CMS_ENCRYPT_INCOMPLETE"] = FAILURE(1057)
# ======================================================================= # 24: NS_ERROR_MODULE_URILOADER # ======================================================================= with modules["URILOADER"]:
errors["NS_ERROR_WONT_HANDLE_CONTENT"] = FAILURE(1) # The load has been cancelled because it was found on a malware or phishing # list.
errors["NS_ERROR_MALWARE_URI"] = FAILURE(30)
errors["NS_ERROR_PHISHING_URI"] = FAILURE(31)
errors["NS_ERROR_TRACKING_URI"] = FAILURE(34)
errors["NS_ERROR_UNWANTED_URI"] = FAILURE(35)
errors["NS_ERROR_BLOCKED_URI"] = FAILURE(37)
errors["NS_ERROR_HARMFUL_URI"] = FAILURE(38)
errors["NS_ERROR_FINGERPRINTING_URI"] = FAILURE(41)
errors["NS_ERROR_CRYPTOMINING_URI"] = FAILURE(42)
errors["NS_ERROR_SOCIALTRACKING_URI"] = FAILURE(43)
errors["NS_ERROR_EMAILTRACKING_URI"] = FAILURE(44) # Used when "Save Link As..." doesn't see the headers quickly enough to # choose a filename. See nsContextMenu.js.
errors["NS_ERROR_SAVE_LINK_AS_TIMEOUT"] = FAILURE(32) # Used when the data from a channel has already been parsed and cached so it # doesn't need to be reparsed from the original source.
errors["NS_ERROR_PARSED_DATA_CACHED"] = FAILURE(33)
# When browser.tabs.documentchannel.parent-controlled pref and SHIP # are enabled and a load gets cancelled due to another one # starting, the error is NS_BINDING_CANCELLED_OLD_LOAD.
errors["NS_BINDING_CANCELLED_OLD_LOAD"] = FAILURE(39)
# ======================================================================= # 25: NS_ERROR_MODULE_CONTENT # ======================================================================= with modules["CONTENT"]: # Error codes for content policy blocking
errors["NS_ERROR_CONTENT_BLOCKED"] = FAILURE(6)
errors["NS_ERROR_CONTENT_BLOCKED_SHOW_ALT"] = FAILURE(7) # Success variations of content policy blocking
errors["NS_PROPTABLE_PROP_NOT_THERE"] = FAILURE(10) # Error code for when the content process crashed
errors["NS_ERROR_CONTENT_CRASHED"] = FAILURE(16) # Error code for when a subframe process crashed
errors["NS_ERROR_FRAME_CRASHED"] = FAILURE(14) # Error code for when the content process had a different buildID than the # parent
errors["NS_ERROR_BUILDID_MISMATCH"] = FAILURE(17)
errors["NS_PROPTABLE_PROP_OVERWRITTEN"] = SUCCESS(11) # Error codes for FindBroadcaster in XULBroadcastManager.cpp
errors["NS_FINDBROADCASTER_NOT_FOUND"] = SUCCESS(12)
errors["NS_FINDBROADCASTER_FOUND"] = SUCCESS(13)
# ======================================================================= # 28: NS_ERROR_MODULE_IPC # ======================================================================= with modules["IPC"]: # Initial creation of a Transport object failed internally for unknown reasons.
errors["NS_ERROR_TRANSPORT_INIT"] = FAILURE(1) # Generic error related to duplicating handle failures.
errors["NS_ERROR_DUPLICATE_HANDLE"] = FAILURE(2) # Bridging: failure trying to open the connection to the parent
errors["NS_ERROR_BRIDGE_OPEN_PARENT"] = FAILURE(3) # Bridging: failure trying to open the connection to the child
errors["NS_ERROR_BRIDGE_OPEN_CHILD"] = FAILURE(4)
# ======================================================================= # 30: NS_ERROR_MODULE_STORAGE # ======================================================================= with modules["STORAGE"]: # To add additional errors to Storage, please append entries to the bottom # of the list in the following format: # NS_ERROR_STORAGE_YOUR_ERR, FAILURE(n) # where n is the next unique positive integer. You must also add an entry # to js/xpconnect/src/xpc.msg under the code block beginning with the # comment 'storage related codes (from mozStorage.h)', in the following # format: 'XPC_MSG_DEF(NS_ERROR_STORAGE_YOUR_ERR, "brief description of your # error")'
errors["NS_ERROR_STORAGE_BUSY"] = FAILURE(1)
errors["NS_ERROR_STORAGE_IOERR"] = FAILURE(2)
errors["NS_ERROR_STORAGE_CONSTRAINT"] = FAILURE(3)
# Specific errors while parsing pver2/pver4 responses
errors["NS_ERROR_UC_PARSER_MISSING_PARAM"] = FAILURE(12)
errors["NS_ERROR_UC_PARSER_DECODE_FAILURE"] = FAILURE(13)
errors["NS_ERROR_UC_PARSER_UNKNOWN_THREAT"] = FAILURE(14)
errors["NS_ERROR_UC_PARSER_MISSING_VALUE"] = FAILURE(15)
# ======================================================================= # 43: NS_ERROR_MODULE_ERRORRESULT # ======================================================================= with modules["ERRORRESULT"]: # Represents a JS Value being thrown as an exception.
errors["NS_ERROR_INTERNAL_ERRORRESULT_JS_EXCEPTION"] = FAILURE(1) # Used to indicate that we want to throw a DOMException.
errors["NS_ERROR_INTERNAL_ERRORRESULT_DOMEXCEPTION"] = FAILURE(2) # Used to indicate that an exception is already pending on the JSContext.
errors["NS_ERROR_INTERNAL_ERRORRESULT_EXCEPTION_ON_JSCONTEXT"] = FAILURE(3) # Used to indicate that we want to throw a TypeError.
errors["NS_ERROR_INTERNAL_ERRORRESULT_TYPEERROR"] = FAILURE(4) # Used to indicate that we want to throw a RangeError.
errors["NS_ERROR_INTERNAL_ERRORRESULT_RANGEERROR"] = FAILURE(5)
# ======================================================================= # 51: NS_ERROR_MODULE_GENERAL # ======================================================================= with modules["GENERAL"]: # Error code used internally by the incremental downloader to cancel the # network channel when the download is already complete.
errors["NS_ERROR_DOWNLOAD_COMPLETE"] = FAILURE(1) # Error code used internally by the incremental downloader to cancel the # network channel when the response to a range request is 200 instead of # 206.
errors["NS_ERROR_DOWNLOAD_NOT_PARTIAL"] = FAILURE(2)
errors["NS_ERROR_UNORM_MOREOUTPUT"] = FAILURE(33)
errors["NS_ERROR_DOCSHELL_REQUEST_REJECTED"] = FAILURE(1001) # This is needed for displaying an error message when navigation is # attempted on a document when printing The value arbitrary as long as it # doesn't conflict with any of the other values in the errors in # DisplayLoadError
errors["NS_ERROR_DOCUMENT_IS_PRINTMODE"] = FAILURE(2001)
errors["NS_SUCCESS_DONT_FIXUP"] = SUCCESS(1) # This success code may be returned by nsIAppStartup::Run to indicate that # the application should be restarted. This condition corresponds to the # case in which nsIAppStartup::Quit was called with the eRestart flag.
errors["NS_SUCCESS_RESTART_APP"] = SUCCESS(1)
# a11y # raised when current pivot's position is needed but it's not in the tree
errors["NS_ERROR_NOT_IN_TREE"] = FAILURE(38)
# see nsTextEquivUtils
errors["NS_OK_NO_NAME_CLAUSE_HANDLED"] = SUCCESS(34)
# Error code used to indicate that functionality has been blocked by the # Policy Manager
errors["NS_ERROR_BLOCKED_BY_POLICY"] = FAILURE(3)
# ============================================================================ # Write out the resulting module declarations to C++ and rust files # ============================================================================
def error_list_h(output):
output.write( """
/* THIS FILE IS GENERATED BY ErrorList.py - DO NOT EDIT */
def error_names_internal_h(output): """Generate ErrorNamesInternal.h, which is a header file declaring one
function, const char* GetErrorNameInternal(nsresult). This method isnot
intended to be used by consumer code, which should instead call
GetErrorName in ErrorNames.h."""
output.write( """
/* THIS FILE IS GENERATED BY ErrorList.py - DO NOT EDIT */
# NOTE: Making sure we don't write out duplicate values is important as # we're using a switch statement to implement this.
seen = set() for error, val in errors.items(): if val notin seen:
output.write(' case nsresult::{0}: return "{0}";\n'.format(error))
seen.add(val)
for mod, val in modules.items():
output.write( "pub const NS_ERROR_MODULE_{}: nsresult = nsresult({});\n".format(
mod, val.num
)
)
for error, val in errors.items():
output.write("pub const {}: nsresult = nsresult(0x{:X});\n".format(error, val))
def gen_jinja(output, input_filename): # This is used to generate Java code for error lists, and can be expanded to # other required contexts in the future if desired. import os
from jinja2 import Environment, FileSystemLoader, StrictUndefined
# FileSystemLoader requires the path to the directory containing templates, # not the file name of the template itself.
(path, leaf) = os.path.split(input_filename)
env = Environment(
loader=FileSystemLoader(path, encoding="utf-8"),
undefined=StrictUndefined,
)
tpl = env.get_template(leaf)
context = { "MODULE_BASE_OFFSET": MODULE_BASE_OFFSET, "modules": ((mod, val.num) for mod, val in modules.items()), "errors": errors.items(),
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.