2 from collections
import OrderedDict
7 A nserror module. When used with a `with` statement, binds the itself to
13 def __init__(self
, num
):
19 def __exit__(self
, _type
, _value
, _traceback
):
23 modules
= OrderedDict()
25 # To add error code to your module, you need to do the following:
27 # 1) Add a module offset code. Add yours to the bottom of the list
28 # right below this comment, adding 1.
30 # 2) In your module, define a header file which uses one of the
31 # NE_ERROR_GENERATExxxxxx macros. Some examples below:
33 # #define NS_ERROR_MYMODULE_MYERROR1 \
34 # NS_ERROR_GENERATE(NS_ERROR_SEVERITY_ERROR,NS_ERROR_MODULE_MYMODULE,1)
35 # #define NS_ERROR_MYMODULE_MYERROR2 NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_MYMODULE,2)
36 # #define NS_ERROR_MYMODULE_MYERROR3 NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_MYMODULE,3)
38 # @name Standard Module Offset Code. Each Module should identify a unique number
39 # and then all errors associated with that module become offsets from the
40 # base associated with that module id. There are 16 bits of code bits for
43 modules
["XPCOM"] = Mod(1)
44 modules
["BASE"] = Mod(2)
45 modules
["GFX"] = Mod(3)
46 modules
["WIDGET"] = Mod(4)
47 modules
["CALENDAR"] = Mod(5)
48 modules
["NETWORK"] = Mod(6)
49 modules
["PLUGINS"] = Mod(7)
50 modules
["LAYOUT"] = Mod(8)
51 modules
["HTMLPARSER"] = Mod(9)
52 modules
["RDF"] = Mod(10)
53 modules
["UCONV"] = Mod(11)
54 modules
["REG"] = Mod(12)
55 modules
["FILES"] = Mod(13)
56 modules
["DOM"] = Mod(14)
57 modules
["IMGLIB"] = Mod(15)
58 modules
["MAILNEWS"] = Mod(16)
59 modules
["EDITOR"] = Mod(17)
60 modules
["XPCONNECT"] = Mod(18)
61 modules
["PROFILE"] = Mod(19)
62 modules
["LDAP"] = Mod(20)
63 modules
["SECURITY"] = Mod(21)
64 modules
["DOM_XPATH"] = Mod(22)
65 # Mod(23) used to be NS_ERROR_MODULE_DOM_RANGE (see bug 711047)
66 modules
["URILOADER"] = Mod(24)
67 modules
["CONTENT"] = Mod(25)
68 modules
["PYXPCOM"] = Mod(26)
69 modules
["XSLT"] = Mod(27)
70 modules
["IPC"] = Mod(28)
71 modules
["SVG"] = Mod(29)
72 modules
["STORAGE"] = Mod(30)
73 modules
["SCHEMA"] = Mod(31)
74 modules
["DOM_FILE"] = Mod(32)
75 modules
["DOM_INDEXEDDB"] = Mod(33)
76 modules
["DOM_FILEHANDLE"] = Mod(34)
77 modules
["SIGNED_JAR"] = Mod(35)
78 modules
["DOM_FILESYSTEM"] = Mod(36)
79 modules
["DOM_BLUETOOTH"] = Mod(37)
80 modules
["SIGNED_APP"] = Mod(38)
81 modules
["DOM_ANIM"] = Mod(39)
82 modules
["DOM_PUSH"] = Mod(40)
83 modules
["DOM_MEDIA"] = Mod(41)
84 modules
["URL_CLASSIFIER"] = Mod(42)
85 # ErrorResult gets its own module to reduce the chance of someone accidentally
86 # defining an error code matching one of the ErrorResult ones.
87 modules
["ERRORRESULT"] = Mod(43)
88 # Win32 system error codes, which are not mapped to a specific other value,
90 modules
["WIN32"] = Mod(44)
92 # NS_ERROR_MODULE_GENERAL should be used by modules that do not
93 # care if return code values overlap. Callers of methods that
94 # return such codes should be aware that they are not
95 # globally unique. Implementors should be careful about blindly
96 # returning codes from other modules that might also use
98 modules
["GENERAL"] = Mod(51)
100 MODULE_BASE_OFFSET
= 0x45
102 NS_ERROR_SEVERITY_SUCCESS
= 0
103 NS_ERROR_SEVERITY_ERROR
= 1
106 def SUCCESS_OR_FAILURE(sev
, module
, code
):
107 return (sev
<< 31) |
((module
+ MODULE_BASE_OFFSET
) << 16) | code
111 return SUCCESS_OR_FAILURE(NS_ERROR_SEVERITY_ERROR
, Mod
.active
.num
, code
)
115 return SUCCESS_OR_FAILURE(NS_ERROR_SEVERITY_SUCCESS
, Mod
.active
.num
, code
)
118 # Errors is an ordered dictionary, so that we can recover the order in which
119 # they were defined. This is important for determining which name is the
120 # canonical name for an error code.
121 errors
= OrderedDict()
123 # Standard "it worked" return value
126 # =======================================================================
127 # Core errors, not part of any modules
128 # =======================================================================
129 errors
["NS_ERROR_BASE"] = 0xC1F30000
130 # Returned when an instance is not initialized
131 errors
["NS_ERROR_NOT_INITIALIZED"] = errors
["NS_ERROR_BASE"] + 1
132 # Returned when an instance is already initialized
133 errors
["NS_ERROR_ALREADY_INITIALIZED"] = errors
["NS_ERROR_BASE"] + 2
134 # Returned by a not implemented function
135 errors
["NS_ERROR_NOT_IMPLEMENTED"] = 0x80004001
136 # Returned when a given interface is not supported.
137 errors
["NS_NOINTERFACE"] = 0x80004002
138 errors
["NS_ERROR_NO_INTERFACE"] = errors
["NS_NOINTERFACE"]
139 # Returned when a function aborts
140 errors
["NS_ERROR_ABORT"] = 0x80004004
141 # Returned when a function fails
142 errors
["NS_ERROR_FAILURE"] = 0x80004005
143 # Returned when an unexpected error occurs
144 errors
["NS_ERROR_UNEXPECTED"] = 0x8000FFFF
145 # Returned when a memory allocation fails
146 errors
["NS_ERROR_OUT_OF_MEMORY"] = 0x8007000E
147 # Returned when an illegal value is passed
148 errors
["NS_ERROR_ILLEGAL_VALUE"] = 0x80070057
149 errors
["NS_ERROR_INVALID_ARG"] = errors
["NS_ERROR_ILLEGAL_VALUE"]
150 errors
["NS_ERROR_INVALID_POINTER"] = errors
["NS_ERROR_INVALID_ARG"]
151 errors
["NS_ERROR_NULL_POINTER"] = errors
["NS_ERROR_INVALID_ARG"]
152 # Returned when an operation can't complete due to an unavailable resource
153 errors
["NS_ERROR_NOT_AVAILABLE"] = 0x80040111
154 # Returned when a class is not registered
155 errors
["NS_ERROR_FACTORY_NOT_REGISTERED"] = 0x80040154
156 # Returned when a class cannot be registered, but may be tried again later
157 errors
["NS_ERROR_FACTORY_REGISTER_AGAIN"] = 0x80040155
158 # Returned when a dynamically loaded factory couldn't be found
159 errors
["NS_ERROR_FACTORY_NOT_LOADED"] = 0x800401F8
160 # Returned when a factory doesn't support signatures
161 errors
["NS_ERROR_FACTORY_NO_SIGNATURE_SUPPORT"] = errors
["NS_ERROR_BASE"] + 0x101
162 # Returned when a factory already is registered
163 errors
["NS_ERROR_FACTORY_EXISTS"] = errors
["NS_ERROR_BASE"] + 0x100
166 # =======================================================================
167 # 1: NS_ERROR_MODULE_XPCOM
168 # =======================================================================
169 with modules
["XPCOM"]:
170 # Result codes used by nsIVariant
171 errors
["NS_ERROR_CANNOT_CONVERT_DATA"] = FAILURE(1)
172 errors
["NS_ERROR_OBJECT_IS_IMMUTABLE"] = FAILURE(2)
173 errors
["NS_ERROR_LOSS_OF_SIGNIFICANT_DATA"] = FAILURE(3)
174 # Result code used by nsIThreadManager
175 errors
["NS_ERROR_NOT_SAME_THREAD"] = FAILURE(4)
176 # Various operations are not permitted during XPCOM shutdown and will fail
177 # with this exception.
178 errors
["NS_ERROR_ILLEGAL_DURING_SHUTDOWN"] = FAILURE(30)
179 errors
["NS_ERROR_SERVICE_NOT_AVAILABLE"] = FAILURE(22)
181 errors
["NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA"] = SUCCESS(1)
182 # Used by nsCycleCollectionParticipant
183 errors
["NS_SUCCESS_INTERRUPTED_TRAVERSE"] = SUCCESS(2)
185 # =======================================================================
186 # 2: NS_ERROR_MODULE_BASE
187 # =======================================================================
188 with modules
["BASE"]:
192 errors
["NS_BASE_STREAM_CLOSED"] = FAILURE(2)
193 # Error from the operating system
194 errors
["NS_BASE_STREAM_OSERROR"] = FAILURE(3)
196 errors
["NS_BASE_STREAM_ILLEGAL_ARGS"] = FAILURE(4)
197 # For unichar streams
198 errors
["NS_BASE_STREAM_NO_CONVERTER"] = FAILURE(5)
199 # For unichar streams
200 errors
["NS_BASE_STREAM_BAD_CONVERSION"] = FAILURE(6)
201 errors
["NS_BASE_STREAM_WOULD_BLOCK"] = FAILURE(7)
204 # =======================================================================
205 # 3: NS_ERROR_MODULE_GFX
206 # =======================================================================
208 # no printer available (e.g. cannot find _any_ printer)
209 errors
["NS_ERROR_GFX_PRINTER_NO_PRINTER_AVAILABLE"] = FAILURE(1)
210 # _specified_ (by name) printer not found
211 errors
["NS_ERROR_GFX_PRINTER_NAME_NOT_FOUND"] = FAILURE(2)
212 # print-to-file: could not open output file
213 errors
["NS_ERROR_GFX_PRINTER_COULD_NOT_OPEN_FILE"] = FAILURE(3)
214 # print: starting document
215 errors
["NS_ERROR_GFX_PRINTER_STARTDOC"] = FAILURE(4)
216 # print: ending document
217 errors
["NS_ERROR_GFX_PRINTER_ENDDOC"] = FAILURE(5)
218 # print: starting page
219 errors
["NS_ERROR_GFX_PRINTER_STARTPAGE"] = FAILURE(6)
220 # The document is still being loaded
221 errors
["NS_ERROR_GFX_PRINTER_DOC_IS_BUSY"] = FAILURE(7)
223 # Font cmap is strangely structured - avoid this font!
224 errors
["NS_ERROR_GFX_CMAP_MALFORMED"] = FAILURE(51)
227 # =======================================================================
228 # 4: NS_ERROR_MODULE_WIDGET
229 # =======================================================================
230 with modules
["WIDGET"]:
232 # - nsIWidget::NotifyIME()
233 # Returned when the notification or the event is handled and it's consumed
235 errors
["NS_SUCCESS_EVENT_CONSUMED"] = SUCCESS(1)
238 # =======================================================================
239 # 6: NS_ERROR_MODULE_NETWORK
240 # =======================================================================
241 with modules
["NETWORK"]:
242 # General async request error codes:
244 # These error codes are commonly passed through callback methods to indicate
245 # the status of some requested async request.
247 # For example, see nsIRequestObserver::onStopRequest.
249 # The async request completed successfully.
250 errors
["NS_BINDING_SUCCEEDED"] = errors
["NS_OK"]
252 # The async request failed for some unknown reason.
253 errors
["NS_BINDING_FAILED"] = FAILURE(1)
254 # The async request failed because it was aborted by some user action.
255 errors
["NS_BINDING_ABORTED"] = FAILURE(2)
256 # The async request has been "redirected" to a different async request.
257 # (e.g., an HTTP redirect occurred).
259 # This error code is used with load groups to notify the load group observer
260 # when a request in the load group is redirected to another request.
261 errors
["NS_BINDING_REDIRECTED"] = FAILURE(3)
262 # The async request has been "retargeted" to a different "handler."
264 # This error code is used with load groups to notify the load group observer
265 # when a request in the load group is removed from the load group and added
266 # to a different load group.
267 errors
["NS_BINDING_RETARGETED"] = FAILURE(4)
269 # Miscellaneous error codes: These errors are not typically passed via
272 # The URI is malformed.
273 errors
["NS_ERROR_MALFORMED_URI"] = FAILURE(10)
274 # The requested action could not be completed while the object is busy.
275 # Implementations of nsIChannel::asyncOpen will commonly return this error
276 # if the channel has already been opened (and has not yet been closed).
277 errors
["NS_ERROR_IN_PROGRESS"] = FAILURE(15)
278 # Returned from nsIChannel::asyncOpen to indicate that OnDataAvailable will
279 # not be called because there is no content available. This is used by
280 # helper app style protocols (e.g., mailto). XXX perhaps this should be a
282 errors
["NS_ERROR_NO_CONTENT"] = FAILURE(17)
283 # The URI scheme corresponds to an unknown protocol handler.
284 errors
["NS_ERROR_UNKNOWN_PROTOCOL"] = FAILURE(18)
285 # The content encoding of the source document was incorrect, for example
286 # returning a plain HTML document advertised as Content-Encoding: gzip
287 errors
["NS_ERROR_INVALID_CONTENT_ENCODING"] = FAILURE(27)
288 # A transport level corruption was found in the source document. for example
289 # a document with a calculated checksum that does not match the Content-MD5
291 errors
["NS_ERROR_CORRUPTED_CONTENT"] = FAILURE(29)
292 # A content signature verification failed for some reason. This can be either
293 # an actual verification error, or any other error that led to the fact that
294 # a content signature that was expected couldn't be verified.
295 errors
["NS_ERROR_INVALID_SIGNATURE"] = FAILURE(58)
296 # While parsing for the first component of a header field using syntax as in
297 # Content-Disposition or Content-Type, the first component was found to be
298 # empty, such as in: Content-Disposition: ; filename=foo
299 errors
["NS_ERROR_FIRST_HEADER_FIELD_COMPONENT_EMPTY"] = FAILURE(34)
300 # Returned from nsIChannel::asyncOpen when trying to open the channel again
301 # (reopening is not supported).
302 errors
["NS_ERROR_ALREADY_OPENED"] = FAILURE(73)
304 # Connectivity error codes:
306 # The connection is already established. XXX unused - consider removing.
307 errors
["NS_ERROR_ALREADY_CONNECTED"] = FAILURE(11)
308 # The connection does not exist. XXX unused - consider removing.
309 errors
["NS_ERROR_NOT_CONNECTED"] = FAILURE(12)
310 # The connection attempt failed, for example, because no server was
311 # listening at specified host:port.
312 errors
["NS_ERROR_CONNECTION_REFUSED"] = FAILURE(13)
313 # The connection was lost due to a timeout error.
314 errors
["NS_ERROR_NET_TIMEOUT"] = FAILURE(14)
315 # The requested action could not be completed while the networking library
316 # is in the offline state.
317 errors
["NS_ERROR_OFFLINE"] = FAILURE(16)
318 # The requested action was prohibited because it would have caused the
319 # networking library to establish a connection to an unsafe or otherwise
321 errors
["NS_ERROR_PORT_ACCESS_NOT_ALLOWED"] = FAILURE(19)
322 # The connection was established, but no data was ever received.
323 errors
["NS_ERROR_NET_RESET"] = FAILURE(20)
324 # The connection was established, but the data transfer was interrupted.
325 errors
["NS_ERROR_NET_INTERRUPT"] = FAILURE(71)
326 # The connection attempt to a proxy failed.
327 errors
["NS_ERROR_PROXY_CONNECTION_REFUSED"] = FAILURE(72)
328 # A transfer was only partially done when it completed.
329 errors
["NS_ERROR_NET_PARTIAL_TRANSFER"] = FAILURE(76)
330 # HTTP/2 detected invalid TLS configuration
331 errors
["NS_ERROR_NET_INADEQUATE_SECURITY"] = FAILURE(82)
332 # HTTP/2 sent a GOAWAY
333 errors
["NS_ERROR_NET_HTTP2_SENT_GOAWAY"] = FAILURE(83)
334 # HTTP/3 protocol internal error
335 errors
["NS_ERROR_NET_HTTP3_PROTOCOL_ERROR"] = FAILURE(84)
336 # A timeout error code that can be used to cancel requests.
337 errors
["NS_ERROR_NET_TIMEOUT_EXTERNAL"] = FAILURE(85)
338 # An error related to HTTPS-only mode
339 errors
["NS_ERROR_HTTPS_ONLY"] = FAILURE(86)
340 # A WebSocket connection is failed.
341 errors
["NS_ERROR_WEBSOCKET_CONNECTION_REFUSED"] = FAILURE(87)
342 # A connection to a non local address is refused because
343 # xpc::AreNonLocalConnectionsDisabled() returns true.
344 errors
["NS_ERROR_NON_LOCAL_CONNECTION_REFUSED"] = FAILURE(88)
345 # Connection to a sts host without a hsts header.
346 errors
["NS_ERROR_BAD_HSTS_CERT"] = FAILURE(89)
348 # XXX really need to better rationalize these error codes. are consumers of
349 # necko really expected to know how to discern the meaning of these??
350 # This request is not resumable, but it was tried to resume it, or to
351 # request resume-specific data.
352 errors
["NS_ERROR_NOT_RESUMABLE"] = FAILURE(25)
353 # The request failed as a result of a detected redirection loop.
354 errors
["NS_ERROR_REDIRECT_LOOP"] = FAILURE(31)
355 # It was attempted to resume the request, but the entity has changed in the
357 errors
["NS_ERROR_ENTITY_CHANGED"] = FAILURE(32)
358 # The request failed because the content type returned by the server was not
359 # a type expected by the channel (for nested channels such as the JAR
361 errors
["NS_ERROR_UNSAFE_CONTENT_TYPE"] = FAILURE(74)
362 # The request resulted in an error page being displayed.
363 errors
["NS_ERROR_LOAD_SHOWED_ERRORPAGE"] = FAILURE(77)
364 # The request occurred in docshell that lacks a treeowner, so it is
365 # probably in the process of being torn down.
366 errors
["NS_ERROR_DOCSHELL_DYING"] = FAILURE(78)
368 # DNS specific error codes:
370 # The lookup of a hostname failed. This generally refers to the hostname
371 # from the URL being loaded.
372 errors
["NS_ERROR_UNKNOWN_HOST"] = FAILURE(30)
373 # A low or medium priority DNS lookup failed because the pending queue was
374 # already full. High priorty (the default) always makes room
375 errors
["NS_ERROR_DNS_LOOKUP_QUEUE_FULL"] = FAILURE(33)
376 # The lookup of a proxy hostname failed. If a channel is configured to
377 # speak to a proxy server, then it will generate this error if the proxy
378 # hostname cannot be resolved.
379 errors
["NS_ERROR_UNKNOWN_PROXY_HOST"] = FAILURE(42)
380 # This DNS error will occur when the resolver uses the Extended DNS Error
381 # option to indicate an error code for which we should not fall back to the
382 # default DNS resolver. This means the DNS failure is definitive.
383 errors
["NS_ERROR_DEFINITIVE_UNKNOWN_HOST"] = FAILURE(43)
385 # Socket specific error codes:
387 # The specified socket type does not exist.
388 errors
["NS_ERROR_UNKNOWN_SOCKET_TYPE"] = FAILURE(51)
389 # The specified socket type could not be created.
390 errors
["NS_ERROR_SOCKET_CREATE_FAILED"] = FAILURE(52)
391 # The operating system doesn't support the given type of address.
392 errors
["NS_ERROR_SOCKET_ADDRESS_NOT_SUPPORTED"] = FAILURE(53)
393 # The address to which we tried to bind the socket was busy.
394 errors
["NS_ERROR_SOCKET_ADDRESS_IN_USE"] = FAILURE(54)
396 # Cache specific error codes:
397 errors
["NS_ERROR_CACHE_KEY_NOT_FOUND"] = FAILURE(61)
398 errors
["NS_ERROR_CACHE_DATA_IS_STREAM"] = FAILURE(62)
399 errors
["NS_ERROR_CACHE_DATA_IS_NOT_STREAM"] = FAILURE(63)
400 errors
["NS_ERROR_CACHE_WAIT_FOR_VALIDATION"] = FAILURE(64)
401 errors
["NS_ERROR_CACHE_ENTRY_DOOMED"] = FAILURE(65)
402 errors
["NS_ERROR_CACHE_READ_ACCESS_DENIED"] = FAILURE(66)
403 errors
["NS_ERROR_CACHE_WRITE_ACCESS_DENIED"] = FAILURE(67)
404 errors
["NS_ERROR_CACHE_IN_USE"] = FAILURE(68)
405 # Error passed through onStopRequest if the document could not be fetched
407 errors
["NS_ERROR_DOCUMENT_NOT_CACHED"] = FAILURE(70)
409 # Effective TLD Service specific error codes:
411 # The requested number of domain levels exceeds those present in the host
413 errors
["NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS"] = FAILURE(80)
414 # The host string is an IP address.
415 errors
["NS_ERROR_HOST_IS_IP_ADDRESS"] = FAILURE(81)
417 # StreamLoader specific result codes:
419 # Result code returned by nsIStreamLoaderObserver to indicate that the
420 # observer is taking over responsibility for the data buffer, and the loader
421 # should NOT free it.
422 errors
["NS_SUCCESS_ADOPTED_DATA"] = SUCCESS(90)
424 # This success code may be returned by nsIAuthModule::getNextToken to
425 # indicate that the authentication is finished and thus there's no need
426 # to call getNextToken again.
427 errors
["NS_SUCCESS_AUTH_FINISHED"] = SUCCESS(40)
429 # These are really not "results", they're statuses, used by nsITransport and
430 # friends. This is abuse of nsresult, but we'll put up with it for now.
432 errors
["NS_NET_STATUS_READING"] = SUCCESS(8)
433 errors
["NS_NET_STATUS_WRITING"] = SUCCESS(9)
436 errors
["NS_NET_STATUS_RESOLVING_HOST"] = SUCCESS(3)
437 errors
["NS_NET_STATUS_RESOLVED_HOST"] = SUCCESS(11)
438 errors
["NS_NET_STATUS_CONNECTING_TO"] = SUCCESS(7)
439 errors
["NS_NET_STATUS_CONNECTED_TO"] = SUCCESS(4)
440 errors
["NS_NET_STATUS_TLS_HANDSHAKE_STARTING"] = SUCCESS(12)
441 errors
["NS_NET_STATUS_TLS_HANDSHAKE_ENDED"] = SUCCESS(13)
442 errors
["NS_NET_STATUS_SENDING_TO"] = SUCCESS(5)
443 errors
["NS_NET_STATUS_WAITING_FOR"] = SUCCESS(10)
444 errors
["NS_NET_STATUS_RECEIVING_FROM"] = SUCCESS(6)
446 # nsIInterceptedChannel
447 # Generic error for non-specific failures during service worker interception
448 errors
["NS_ERROR_INTERCEPTION_FAILED"] = FAILURE(100)
450 errors
["NS_ERROR_WEBTRANSPORT_CODE_BASE"] = FAILURE(200)
451 errors
["NS_ERROR_WEBTRANSPORT_CODE_END"] = (
452 errors
["NS_ERROR_WEBTRANSPORT_CODE_BASE"] + 255
455 # All Http proxy CONNECT response codes
456 errors
["NS_ERROR_PROXY_CODE_BASE"] = FAILURE(1000)
458 errors
["NS_ERROR_PROXY_MULTIPLE_CHOICES"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 300
459 errors
["NS_ERROR_PROXY_MOVED_PERMANENTLY"] = (
460 errors
["NS_ERROR_PROXY_CODE_BASE"] + 301
462 errors
["NS_ERROR_PROXY_FOUND"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 302
463 errors
["NS_ERROR_PROXY_SEE_OTHER"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 303
464 errors
["NS_ERROR_PROXY_NOT_MODIFIED"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 304
465 errors
["NS_ERROR_PROXY_TEMPORARY_REDIRECT"] = (
466 errors
["NS_ERROR_PROXY_CODE_BASE"] + 307
468 errors
["NS_ERROR_PROXY_PERMANENT_REDIRECT"] = (
469 errors
["NS_ERROR_PROXY_CODE_BASE"] + 308
473 errors
["NS_ERROR_PROXY_BAD_REQUEST"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 400
474 errors
["NS_ERROR_PROXY_UNAUTHORIZED"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 401
475 errors
["NS_ERROR_PROXY_PAYMENT_REQUIRED"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 402
476 errors
["NS_ERROR_PROXY_FORBIDDEN"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 403
477 errors
["NS_ERROR_PROXY_NOT_FOUND"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 404
478 errors
["NS_ERROR_PROXY_METHOD_NOT_ALLOWED"] = (
479 errors
["NS_ERROR_PROXY_CODE_BASE"] + 405
481 errors
["NS_ERROR_PROXY_NOT_ACCEPTABLE"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 406
482 # The proxy requires authentication; used when we can't easily propagate 407s.
483 errors
["NS_ERROR_PROXY_AUTHENTICATION_FAILED"] = (
484 errors
["NS_ERROR_PROXY_CODE_BASE"] + 407
486 errors
["NS_ERROR_PROXY_REQUEST_TIMEOUT"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 408
487 errors
["NS_ERROR_PROXY_CONFLICT"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 409
488 errors
["NS_ERROR_PROXY_GONE"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 410
489 errors
["NS_ERROR_PROXY_LENGTH_REQUIRED"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 411
490 errors
["NS_ERROR_PROXY_PRECONDITION_FAILED"] = (
491 errors
["NS_ERROR_PROXY_CODE_BASE"] + 412
493 errors
["NS_ERROR_PROXY_REQUEST_ENTITY_TOO_LARGE"] = (
494 errors
["NS_ERROR_PROXY_CODE_BASE"] + 413
496 errors
["NS_ERROR_PROXY_REQUEST_URI_TOO_LONG"] = (
497 errors
["NS_ERROR_PROXY_CODE_BASE"] + 414
499 errors
["NS_ERROR_PROXY_UNSUPPORTED_MEDIA_TYPE"] = (
500 errors
["NS_ERROR_PROXY_CODE_BASE"] + 415
502 errors
["NS_ERROR_PROXY_REQUESTED_RANGE_NOT_SATISFIABLE"] = (
503 errors
["NS_ERROR_PROXY_CODE_BASE"] + 416
505 errors
["NS_ERROR_PROXY_EXPECTATION_FAILED"] = (
506 errors
["NS_ERROR_PROXY_CODE_BASE"] + 417
508 errors
["NS_ERROR_PROXY_MISDIRECTED_REQUEST"] = (
509 errors
["NS_ERROR_PROXY_CODE_BASE"] + 421
511 errors
["NS_ERROR_PROXY_TOO_EARLY"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 425
512 errors
["NS_ERROR_PROXY_UPGRADE_REQUIRED"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 426
513 errors
["NS_ERROR_PROXY_PRECONDITION_REQUIRED"] = (
514 errors
["NS_ERROR_PROXY_CODE_BASE"] + 428
516 # Indicates that we have sent too many requests in a given amount of time.
517 errors
["NS_ERROR_PROXY_TOO_MANY_REQUESTS"] = (
518 errors
["NS_ERROR_PROXY_CODE_BASE"] + 429
520 errors
["NS_ERROR_PROXY_REQUEST_HEADER_FIELDS_TOO_LARGE"] = (
521 errors
["NS_ERROR_PROXY_CODE_BASE"] + 431
523 errors
["NS_ERROR_PROXY_UNAVAILABLE_FOR_LEGAL_REASONS"] = (
524 errors
["NS_ERROR_PROXY_CODE_BASE"] + 451
528 errors
["NS_ERROR_PROXY_INTERNAL_SERVER_ERROR"] = (
529 errors
["NS_ERROR_PROXY_CODE_BASE"] + 500
531 errors
["NS_ERROR_PROXY_NOT_IMPLEMENTED"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 501
532 errors
["NS_ERROR_PROXY_BAD_GATEWAY"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 502
533 errors
["NS_ERROR_PROXY_SERVICE_UNAVAILABLE"] = (
534 errors
["NS_ERROR_PROXY_CODE_BASE"] + 503
536 # The proxy did get any response from the remote server in time.
537 errors
["NS_ERROR_PROXY_GATEWAY_TIMEOUT"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 504
538 errors
["NS_ERROR_PROXY_VERSION_NOT_SUPPORTED"] = (
539 errors
["NS_ERROR_PROXY_CODE_BASE"] + 505
541 errors
["NS_ERROR_PROXY_VARIANT_ALSO_NEGOTIATES"] = (
542 errors
["NS_ERROR_PROXY_CODE_BASE"] + 506
544 errors
["NS_ERROR_PROXY_NOT_EXTENDED"] = errors
["NS_ERROR_PROXY_CODE_BASE"] + 510
545 errors
["NS_ERROR_PROXY_NETWORK_AUTHENTICATION_REQUIRED"] = (
546 errors
["NS_ERROR_PROXY_CODE_BASE"] + 511
549 # =======================================================================
550 # 7: NS_ERROR_MODULE_PLUGINS
551 # =======================================================================
552 with modules
["PLUGINS"]:
553 errors
["NS_ERROR_PLUGINS_PLUGINSNOTCHANGED"] = FAILURE(1000)
554 errors
["NS_ERROR_PLUGIN_DISABLED"] = FAILURE(1001)
555 errors
["NS_ERROR_PLUGIN_BLOCKLISTED"] = FAILURE(1002)
556 errors
["NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED"] = FAILURE(1003)
557 errors
["NS_ERROR_PLUGIN_CLICKTOPLAY"] = FAILURE(1004)
560 # =======================================================================
561 # 8: NS_ERROR_MODULE_LAYOUT
562 # =======================================================================
563 with modules
["LAYOUT"]:
564 # Return code for SheetLoadData::VerifySheetReadyToParse
565 errors
["NS_OK_PARSE_SHEET"] = SUCCESS(1)
568 # =======================================================================
569 # 9: NS_ERROR_MODULE_HTMLPARSER
570 # =======================================================================
571 with modules
["HTMLPARSER"]:
572 errors
["NS_ERROR_HTMLPARSER_CONTINUE"] = errors
["NS_OK"]
574 errors
["NS_ERROR_HTMLPARSER_EOF"] = FAILURE(1000)
575 errors
["NS_ERROR_HTMLPARSER_UNKNOWN"] = FAILURE(1001)
576 errors
["NS_ERROR_HTMLPARSER_CANTPROPAGATE"] = FAILURE(1002)
577 errors
["NS_ERROR_HTMLPARSER_CONTEXTMISMATCH"] = FAILURE(1003)
578 errors
["NS_ERROR_HTMLPARSER_BADFILENAME"] = FAILURE(1004)
579 errors
["NS_ERROR_HTMLPARSER_BADURL"] = FAILURE(1005)
580 errors
["NS_ERROR_HTMLPARSER_INVALIDPARSERCONTEXT"] = FAILURE(1006)
581 errors
["NS_ERROR_HTMLPARSER_INTERRUPTED"] = FAILURE(1007)
582 errors
["NS_ERROR_HTMLPARSER_BLOCK"] = FAILURE(1008)
583 errors
["NS_ERROR_HTMLPARSER_BADTOKENIZER"] = FAILURE(1009)
584 errors
["NS_ERROR_HTMLPARSER_BADATTRIBUTE"] = FAILURE(1010)
585 errors
["NS_ERROR_HTMLPARSER_UNRESOLVEDDTD"] = FAILURE(1011)
586 errors
["NS_ERROR_HTMLPARSER_MISPLACEDTABLECONTENT"] = FAILURE(1012)
587 errors
["NS_ERROR_HTMLPARSER_BADDTD"] = FAILURE(1013)
588 errors
["NS_ERROR_HTMLPARSER_BADCONTEXT"] = FAILURE(1014)
589 errors
["NS_ERROR_HTMLPARSER_STOPPARSING"] = FAILURE(1015)
590 errors
["NS_ERROR_HTMLPARSER_UNTERMINATEDSTRINGLITERAL"] = FAILURE(1016)
591 errors
["NS_ERROR_HTMLPARSER_HIERARCHYTOODEEP"] = FAILURE(1017)
592 errors
["NS_ERROR_HTMLPARSER_FAKE_ENDTAG"] = FAILURE(1018)
593 errors
["NS_ERROR_HTMLPARSER_INVALID_COMMENT"] = FAILURE(1019)
596 # =======================================================================
597 # 10: NS_ERROR_MODULE_RDF
598 # =======================================================================
600 # Returned from nsIRDFDataSource::Assert() and Unassert() if the assertion
601 # (or unassertion was accepted by the datasource
602 errors
["NS_RDF_ASSERTION_ACCEPTED"] = errors
["NS_OK"]
603 # Returned from nsIRDFDataSource::GetSource() and GetTarget() if the
604 # source/target has no value
605 errors
["NS_RDF_NO_VALUE"] = SUCCESS(2)
606 # Returned from nsIRDFDataSource::Assert() and Unassert() if the assertion
607 # (or unassertion) was rejected by the datasource; i.e., the datasource was
608 # not willing to record the statement.
609 errors
["NS_RDF_ASSERTION_REJECTED"] = SUCCESS(3)
610 # Return this from rdfITripleVisitor to stop cycling
611 errors
["NS_RDF_STOP_VISIT"] = SUCCESS(4)
614 # =======================================================================
615 # 11: NS_ERROR_MODULE_UCONV
616 # =======================================================================
617 with modules
["UCONV"]:
618 errors
["NS_ERROR_UCONV_NOCONV"] = FAILURE(1)
619 errors
["NS_ERROR_UDEC_ILLEGALINPUT"] = FAILURE(14)
621 errors
["NS_OK_HAD_REPLACEMENTS"] = SUCCESS(3)
622 errors
["NS_OK_UDEC_MOREINPUT"] = SUCCESS(12)
623 errors
["NS_OK_UDEC_MOREOUTPUT"] = SUCCESS(13)
624 errors
["NS_OK_UENC_MOREOUTPUT"] = SUCCESS(34)
625 errors
["NS_ERROR_UENC_NOMAPPING"] = SUCCESS(35)
628 errors
["NS_ERROR_ILLEGAL_INPUT"] = errors
["NS_ERROR_UDEC_ILLEGALINPUT"]
632 # =======================================================================
633 # 13: NS_ERROR_MODULE_FILES
634 # =======================================================================
635 with modules
["FILES"]:
636 errors
["NS_ERROR_FILE_UNRECOGNIZED_PATH"] = FAILURE(1)
637 errors
["NS_ERROR_FILE_UNRESOLVABLE_SYMLINK"] = FAILURE(2)
638 errors
["NS_ERROR_FILE_EXECUTION_FAILED"] = FAILURE(3)
639 errors
["NS_ERROR_FILE_UNKNOWN_TYPE"] = FAILURE(4)
640 errors
["NS_ERROR_FILE_DESTINATION_NOT_DIR"] = FAILURE(5)
641 errors
["NS_ERROR_FILE_COPY_OR_MOVE_FAILED"] = FAILURE(7)
642 errors
["NS_ERROR_FILE_ALREADY_EXISTS"] = FAILURE(8)
643 errors
["NS_ERROR_FILE_INVALID_PATH"] = FAILURE(9)
644 errors
["NS_ERROR_FILE_CORRUPTED"] = FAILURE(11)
645 errors
["NS_ERROR_FILE_NOT_DIRECTORY"] = FAILURE(12)
646 errors
["NS_ERROR_FILE_IS_DIRECTORY"] = FAILURE(13)
647 errors
["NS_ERROR_FILE_IS_LOCKED"] = FAILURE(14)
648 errors
["NS_ERROR_FILE_TOO_BIG"] = FAILURE(15)
649 errors
["NS_ERROR_FILE_NO_DEVICE_SPACE"] = FAILURE(16)
650 errors
["NS_ERROR_FILE_NAME_TOO_LONG"] = FAILURE(17)
651 errors
["NS_ERROR_FILE_NOT_FOUND"] = FAILURE(18)
652 errors
["NS_ERROR_FILE_READ_ONLY"] = FAILURE(19)
653 errors
["NS_ERROR_FILE_DIR_NOT_EMPTY"] = FAILURE(20)
654 errors
["NS_ERROR_FILE_ACCESS_DENIED"] = FAILURE(21)
655 errors
["NS_ERROR_FILE_FS_CORRUPTED"] = FAILURE(22)
656 errors
["NS_ERROR_FILE_DEVICE_FAILURE"] = FAILURE(23)
657 errors
["NS_ERROR_FILE_DEVICE_TEMPORARY_FAILURE"] = FAILURE(24)
658 errors
["NS_ERROR_FILE_INVALID_HANDLE"] = FAILURE(25)
660 errors
["NS_SUCCESS_FILE_DIRECTORY_EMPTY"] = SUCCESS(1)
661 # Result codes used by nsIDirectoryServiceProvider2
662 errors
["NS_SUCCESS_AGGREGATE_RESULT"] = SUCCESS(2)
665 # =======================================================================
666 # 14: NS_ERROR_MODULE_DOM
667 # =======================================================================
669 # XXX If you add a new DOM error code, also add an error string to
670 # dom/base/domerr.msg
672 # Standard DOM error codes: http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
673 errors
["NS_ERROR_DOM_INDEX_SIZE_ERR"] = FAILURE(1)
674 errors
["NS_ERROR_DOM_HIERARCHY_REQUEST_ERR"] = FAILURE(3)
675 errors
["NS_ERROR_DOM_WRONG_DOCUMENT_ERR"] = FAILURE(4)
676 errors
["NS_ERROR_DOM_INVALID_CHARACTER_ERR"] = FAILURE(5)
677 errors
["NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR"] = FAILURE(7)
678 errors
["NS_ERROR_DOM_NOT_FOUND_ERR"] = FAILURE(8)
679 errors
["NS_ERROR_DOM_NOT_SUPPORTED_ERR"] = FAILURE(9)
680 errors
["NS_ERROR_DOM_INUSE_ATTRIBUTE_ERR"] = FAILURE(10)
681 errors
["NS_ERROR_DOM_INVALID_STATE_ERR"] = FAILURE(11)
682 errors
["NS_ERROR_DOM_SYNTAX_ERR"] = FAILURE(12)
683 errors
["NS_ERROR_DOM_INVALID_MODIFICATION_ERR"] = FAILURE(13)
684 errors
["NS_ERROR_DOM_NAMESPACE_ERR"] = FAILURE(14)
685 errors
["NS_ERROR_DOM_INVALID_ACCESS_ERR"] = FAILURE(15)
686 errors
["NS_ERROR_DOM_TYPE_MISMATCH_ERR"] = FAILURE(17)
687 errors
["NS_ERROR_DOM_SECURITY_ERR"] = FAILURE(18)
688 errors
["NS_ERROR_DOM_NETWORK_ERR"] = FAILURE(19)
689 errors
["NS_ERROR_DOM_ABORT_ERR"] = FAILURE(20)
690 errors
["NS_ERROR_DOM_URL_MISMATCH_ERR"] = FAILURE(21)
691 errors
["NS_ERROR_DOM_QUOTA_EXCEEDED_ERR"] = FAILURE(22)
692 errors
["NS_ERROR_DOM_TIMEOUT_ERR"] = FAILURE(23)
693 errors
["NS_ERROR_DOM_INVALID_NODE_TYPE_ERR"] = FAILURE(24)
694 errors
["NS_ERROR_DOM_DATA_CLONE_ERR"] = FAILURE(25)
695 # StringEncoding API errors from http://wiki.whatwg.org/wiki/StringEncoding
696 errors
["NS_ERROR_DOM_ENCODING_NOT_SUPPORTED_ERR"] = FAILURE(28)
697 # WebCrypto API errors from http://www.w3.org/TR/WebCryptoAPI/
698 errors
["NS_ERROR_DOM_UNKNOWN_ERR"] = FAILURE(30)
699 errors
["NS_ERROR_DOM_DATA_ERR"] = FAILURE(31)
700 errors
["NS_ERROR_DOM_OPERATION_ERR"] = FAILURE(32)
701 # https://heycam.github.io/webidl/#notallowederror
702 errors
["NS_ERROR_DOM_NOT_ALLOWED_ERR"] = FAILURE(33)
703 # DOM error codes defined by us
704 errors
["NS_ERROR_DOM_WRONG_TYPE_ERR"] = FAILURE(1002)
705 errors
["NS_ERROR_DOM_NOT_NUMBER_ERR"] = FAILURE(1005)
706 errors
["NS_ERROR_DOM_PROP_ACCESS_DENIED"] = FAILURE(1010)
707 errors
["NS_ERROR_DOM_XPCONNECT_ACCESS_DENIED"] = FAILURE(1011)
708 errors
["NS_ERROR_DOM_BAD_URI"] = FAILURE(1012)
709 errors
["NS_ERROR_DOM_RETVAL_UNDEFINED"] = FAILURE(1013)
711 # A way to represent uncatchable exceptions
712 errors
["NS_ERROR_UNCATCHABLE_EXCEPTION"] = FAILURE(1015)
714 errors
["NS_ERROR_DOM_MALFORMED_URI"] = FAILURE(1016)
715 errors
["NS_ERROR_DOM_INVALID_HEADER_NAME"] = FAILURE(1017)
717 errors
["NS_ERROR_DOM_INVALID_STATE_XHR_HAS_INVALID_CONTEXT"] = FAILURE(1018)
719 # When manipulating the bytecode cache with the JS API, some transcoding
720 # errors, such as a different bytecode format can cause failures of the
722 errors
["NS_ERROR_DOM_JS_DECODING_ERROR"] = FAILURE(1026)
724 # Image decode errors.
725 errors
["NS_ERROR_DOM_IMAGE_INACTIVE_DOCUMENT"] = FAILURE(1027)
726 errors
["NS_ERROR_DOM_IMAGE_INVALID_REQUEST"] = FAILURE(1028)
727 errors
["NS_ERROR_DOM_IMAGE_BROKEN"] = FAILURE(1029)
729 # Used to indicate that a resource with the Cross-Origin-Resource-Policy
730 # response header set failed the origin check.
731 # https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header
732 errors
["NS_ERROR_DOM_CORP_FAILED"] = FAILURE(1036)
734 # Used to indicate that a URI may not be loaded into a cross-origin
736 errors
["NS_ERROR_DOM_BAD_CROSS_ORIGIN_URI"] = FAILURE(1037)
738 # The request failed because there are too many recursive iframes or
739 # objects being loaded.
740 errors
["NS_ERROR_RECURSIVE_DOCUMENT_LOAD"] = FAILURE(1038)
742 # WebExtension content script may not load this URL.
743 errors
["NS_ERROR_DOM_WEBEXT_CONTENT_SCRIPT_URI"] = FAILURE(1039)
745 # Used to indicate that a resource load was blocked because of the
746 # Cross-Origin-Embedder-Policy response header.
747 # https://html.spec.whatwg.org/multipage/origin.html#coep
748 errors
["NS_ERROR_DOM_COEP_FAILED"] = FAILURE(1040)
750 # Used to indicate that a resource load was blocked because of the
751 # Cross-Origin-Opener-Policy response header.
752 # https://html.spec.whatwg.org/multipage/origin.html#cross-origin-opener-policies
753 errors
["NS_ERROR_DOM_COOP_FAILED"] = FAILURE(1041)
755 # May be used to indicate when e.g. setting a property value didn't
756 # actually change the value, like for obj.foo = "bar"; obj.foo = "bar";
757 # the second assignment throws NS_SUCCESS_DOM_NO_OPERATION.
758 errors
["NS_SUCCESS_DOM_NO_OPERATION"] = SUCCESS(1)
760 # A success code that indicates that evaluating a string of JS went
761 # just fine except it threw an exception. Only for legacy use by
763 errors
["NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW"] = SUCCESS(2)
765 # A success code that indicates that evaluating a string of JS went
766 # just fine except it was killed by an uncatchable exception.
767 # Only for legacy use by nsJSUtils.
768 errors
["NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW_UNCATCHABLE"] = SUCCESS(3)
771 # =======================================================================
772 # 15: NS_ERROR_MODULE_IMGLIB
773 # =======================================================================
774 with modules
["IMGLIB"]:
775 errors
["NS_IMAGELIB_ERROR_FAILURE"] = FAILURE(5)
776 errors
["NS_IMAGELIB_ERROR_NO_DECODER"] = FAILURE(6)
777 errors
["NS_IMAGELIB_ERROR_NOT_FINISHED"] = FAILURE(7)
778 errors
["NS_IMAGELIB_ERROR_NO_ENCODER"] = FAILURE(9)
781 # =======================================================================
782 # 17: NS_ERROR_MODULE_EDITOR
783 # =======================================================================
784 with modules
["EDITOR"]:
785 errors
["NS_ERROR_EDITOR_DESTROYED"] = FAILURE(1)
787 # An error code that indicates that the DOM tree has been modified by
788 # web app or add-on while the editor modifying the tree. However,
789 # this shouldn't be exposed to the web because the result should've
790 # been expected by the web app.
791 errors
["NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE"] = FAILURE(2)
793 # An error code that indicates that the edit action canceled by
794 # clipboard event listener or beforeinput event listener. Note that
795 # don't make this as a success code since it's not check with NS_FAILED()
796 # and may keep handling the operation unexpectedly.
797 errors
["NS_ERROR_EDITOR_ACTION_CANCELED"] = FAILURE(3)
799 # An error code that indicates that there is no editable selection ranges.
800 # E.g., Selection has no range, caret is in non-editable element,
801 # non-collapsed range crosses editing host boundaries.
802 errors
["NS_ERROR_EDITOR_NO_EDITABLE_RANGE"] = FAILURE(4)
804 errors
["NS_SUCCESS_EDITOR_ELEMENT_NOT_FOUND"] = SUCCESS(1)
805 errors
["NS_SUCCESS_EDITOR_FOUND_TARGET"] = SUCCESS(2)
807 # If most callers ignore error except serious error (like
808 # NS_ERROR_EDITOR_DESTROYED), this success code is useful. E.g. such
810 # nsresult rv = Foo();
811 # if (MOZ_UNLIKELY(NS_FAILED(rv))) {
812 # NS_WARNING("Foo() failed");
815 # NS_WARNING_ASSERTION(
816 # rv != NS_SUCCESS_EDITOR_BUT_IGNORED_TRIVIAL_ERROR,
817 # "Foo() failed, but ignored");
818 errors
["NS_SUCCESS_EDITOR_BUT_IGNORED_TRIVIAL_ERROR"] = SUCCESS(3)
821 # =======================================================================
822 # 18: NS_ERROR_MODULE_XPCONNECT
823 # =======================================================================
824 with modules
["XPCONNECT"]:
825 errors
["NS_ERROR_XPC_NOT_ENOUGH_ARGS"] = FAILURE(1)
826 errors
["NS_ERROR_XPC_NEED_OUT_OBJECT"] = FAILURE(2)
827 errors
["NS_ERROR_XPC_CANT_SET_OUT_VAL"] = FAILURE(3)
828 errors
["NS_ERROR_XPC_NATIVE_RETURNED_FAILURE"] = FAILURE(4)
829 errors
["NS_ERROR_XPC_CANT_GET_INTERFACE_INFO"] = FAILURE(5)
830 errors
["NS_ERROR_XPC_CANT_GET_PARAM_IFACE_INFO"] = FAILURE(6)
831 errors
["NS_ERROR_XPC_CANT_GET_METHOD_INFO"] = FAILURE(7)
832 errors
["NS_ERROR_XPC_UNEXPECTED"] = FAILURE(8)
833 errors
["NS_ERROR_XPC_BAD_CONVERT_JS"] = FAILURE(9)
834 errors
["NS_ERROR_XPC_BAD_CONVERT_NATIVE"] = FAILURE(10)
835 errors
["NS_ERROR_XPC_BAD_CONVERT_JS_NULL_REF"] = FAILURE(11)
836 errors
["NS_ERROR_XPC_BAD_OP_ON_WN_PROTO"] = FAILURE(12)
837 errors
["NS_ERROR_XPC_CANT_CONVERT_WN_TO_FUN"] = FAILURE(13)
838 errors
["NS_ERROR_XPC_CANT_DEFINE_PROP_ON_WN"] = FAILURE(14)
839 errors
["NS_ERROR_XPC_CANT_WATCH_WN_STATIC"] = FAILURE(15)
840 errors
["NS_ERROR_XPC_CANT_EXPORT_WN_STATIC"] = FAILURE(16)
841 errors
["NS_ERROR_XPC_SCRIPTABLE_CALL_FAILED"] = FAILURE(17)
842 errors
["NS_ERROR_XPC_SCRIPTABLE_CTOR_FAILED"] = FAILURE(18)
843 errors
["NS_ERROR_XPC_CANT_CALL_WO_SCRIPTABLE"] = FAILURE(19)
844 errors
["NS_ERROR_XPC_CANT_CTOR_WO_SCRIPTABLE"] = FAILURE(20)
845 errors
["NS_ERROR_XPC_CI_RETURNED_FAILURE"] = FAILURE(21)
846 errors
["NS_ERROR_XPC_GS_RETURNED_FAILURE"] = FAILURE(22)
847 errors
["NS_ERROR_XPC_BAD_CID"] = FAILURE(23)
848 errors
["NS_ERROR_XPC_BAD_IID"] = FAILURE(24)
849 errors
["NS_ERROR_XPC_CANT_CREATE_WN"] = FAILURE(25)
850 errors
["NS_ERROR_XPC_JS_THREW_EXCEPTION"] = FAILURE(26)
851 errors
["NS_ERROR_XPC_JS_THREW_NATIVE_OBJECT"] = FAILURE(27)
852 errors
["NS_ERROR_XPC_JS_THREW_JS_OBJECT"] = FAILURE(28)
853 errors
["NS_ERROR_XPC_JS_THREW_NULL"] = FAILURE(29)
854 errors
["NS_ERROR_XPC_JS_THREW_STRING"] = FAILURE(30)
855 errors
["NS_ERROR_XPC_JS_THREW_NUMBER"] = FAILURE(31)
856 errors
["NS_ERROR_XPC_JAVASCRIPT_ERROR"] = FAILURE(32)
857 errors
["NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS"] = FAILURE(33)
858 errors
["NS_ERROR_XPC_CANT_CONVERT_PRIMITIVE_TO_ARRAY"] = FAILURE(34)
859 errors
["NS_ERROR_XPC_CANT_CONVERT_OBJECT_TO_ARRAY"] = FAILURE(35)
860 errors
["NS_ERROR_XPC_NOT_ENOUGH_ELEMENTS_IN_ARRAY"] = FAILURE(36)
861 errors
["NS_ERROR_XPC_CANT_GET_ARRAY_INFO"] = FAILURE(37)
862 errors
["NS_ERROR_XPC_NOT_ENOUGH_CHARS_IN_STRING"] = FAILURE(38)
863 errors
["NS_ERROR_XPC_SECURITY_MANAGER_VETO"] = FAILURE(39)
864 errors
["NS_ERROR_XPC_INTERFACE_NOT_SCRIPTABLE"] = FAILURE(40)
865 errors
["NS_ERROR_XPC_INTERFACE_NOT_FROM_NSISUPPORTS"] = FAILURE(41)
866 errors
["NS_ERROR_XPC_CANT_SET_READ_ONLY_CONSTANT"] = FAILURE(43)
867 errors
["NS_ERROR_XPC_CANT_SET_READ_ONLY_ATTRIBUTE"] = FAILURE(44)
868 errors
["NS_ERROR_XPC_CANT_SET_READ_ONLY_METHOD"] = FAILURE(45)
869 errors
["NS_ERROR_XPC_CANT_ADD_PROP_TO_WRAPPED_NATIVE"] = FAILURE(46)
870 errors
["NS_ERROR_XPC_CALL_TO_SCRIPTABLE_FAILED"] = FAILURE(47)
871 errors
["NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED"] = FAILURE(48)
872 errors
["NS_ERROR_XPC_BAD_ID_STRING"] = FAILURE(49)
873 errors
["NS_ERROR_XPC_BAD_INITIALIZER_NAME"] = FAILURE(50)
874 errors
["NS_ERROR_XPC_HAS_BEEN_SHUTDOWN"] = FAILURE(51)
875 errors
["NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN"] = FAILURE(52)
876 errors
["NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL"] = FAILURE(53)
877 # any new errors here should have an associated entry added in xpc.msg
880 # =======================================================================
881 # 19: NS_ERROR_MODULE_PROFILE
882 # =======================================================================
883 with modules
["PROFILE"]:
884 errors
["NS_ERROR_LAUNCHED_CHILD_PROCESS"] = FAILURE(200)
885 errors
["NS_ERROR_SHOW_PROFILE_MANAGER"] = FAILURE(201)
886 errors
["NS_ERROR_DATABASE_CHANGED"] = FAILURE(202)
889 # =======================================================================
890 # 21: NS_ERROR_MODULE_SECURITY
891 # =======================================================================
892 with modules
["SECURITY"]:
894 errors
["NS_ERROR_XFO_VIOLATION"] = FAILURE(96)
897 errors
["NS_ERROR_CSP_NAVIGATE_TO_VIOLATION"] = FAILURE(97)
898 errors
["NS_ERROR_CSP_FORM_ACTION_VIOLATION"] = FAILURE(98)
899 errors
["NS_ERROR_CSP_FRAME_ANCESTOR_VIOLATION"] = FAILURE(99)
901 # Error code for Sub-Resource Integrity
902 errors
["NS_ERROR_SRI_CORRUPT"] = FAILURE(200)
903 errors
["NS_ERROR_SRI_NOT_ELIGIBLE"] = FAILURE(201)
904 errors
["NS_ERROR_SRI_UNEXPECTED_HASH_TYPE"] = FAILURE(202)
905 errors
["NS_ERROR_SRI_IMPORT"] = FAILURE(203)
907 # CMS specific nsresult error codes. Note: the numbers used here correspond
908 # to the values in nsICMSMessageErrors.idl.
909 errors
["NS_ERROR_CMS_VERIFY_NOT_SIGNED"] = FAILURE(1024)
910 errors
["NS_ERROR_CMS_VERIFY_NO_CONTENT_INFO"] = FAILURE(1025)
911 errors
["NS_ERROR_CMS_VERIFY_BAD_DIGEST"] = FAILURE(1026)
912 errors
["NS_ERROR_CMS_VERIFY_NOCERT"] = FAILURE(1028)
913 errors
["NS_ERROR_CMS_VERIFY_UNTRUSTED"] = FAILURE(1029)
914 errors
["NS_ERROR_CMS_VERIFY_ERROR_UNVERIFIED"] = FAILURE(1031)
915 errors
["NS_ERROR_CMS_VERIFY_ERROR_PROCESSING"] = FAILURE(1032)
916 errors
["NS_ERROR_CMS_VERIFY_BAD_SIGNATURE"] = FAILURE(1033)
917 errors
["NS_ERROR_CMS_VERIFY_DIGEST_MISMATCH"] = FAILURE(1034)
918 errors
["NS_ERROR_CMS_VERIFY_UNKNOWN_ALGO"] = FAILURE(1035)
919 errors
["NS_ERROR_CMS_VERIFY_UNSUPPORTED_ALGO"] = FAILURE(1036)
920 errors
["NS_ERROR_CMS_VERIFY_MALFORMED_SIGNATURE"] = FAILURE(1037)
921 errors
["NS_ERROR_CMS_VERIFY_HEADER_MISMATCH"] = FAILURE(1038)
922 errors
["NS_ERROR_CMS_VERIFY_NOT_YET_ATTEMPTED"] = FAILURE(1039)
923 errors
["NS_ERROR_CMS_VERIFY_CERT_WITHOUT_ADDRESS"] = FAILURE(1040)
924 errors
["NS_ERROR_CMS_ENCRYPT_NO_BULK_ALG"] = FAILURE(1056)
925 errors
["NS_ERROR_CMS_ENCRYPT_INCOMPLETE"] = FAILURE(1057)
928 # =======================================================================
929 # 24: NS_ERROR_MODULE_URILOADER
930 # =======================================================================
931 with modules
["URILOADER"]:
932 errors
["NS_ERROR_WONT_HANDLE_CONTENT"] = FAILURE(1)
933 # The load has been cancelled because it was found on a malware or phishing
935 errors
["NS_ERROR_MALWARE_URI"] = FAILURE(30)
936 errors
["NS_ERROR_PHISHING_URI"] = FAILURE(31)
937 errors
["NS_ERROR_TRACKING_URI"] = FAILURE(34)
938 errors
["NS_ERROR_UNWANTED_URI"] = FAILURE(35)
939 errors
["NS_ERROR_BLOCKED_URI"] = FAILURE(37)
940 errors
["NS_ERROR_HARMFUL_URI"] = FAILURE(38)
941 errors
["NS_ERROR_FINGERPRINTING_URI"] = FAILURE(41)
942 errors
["NS_ERROR_CRYPTOMINING_URI"] = FAILURE(42)
943 errors
["NS_ERROR_SOCIALTRACKING_URI"] = FAILURE(43)
944 errors
["NS_ERROR_EMAILTRACKING_URI"] = FAILURE(44)
945 # Used when "Save Link As..." doesn't see the headers quickly enough to
946 # choose a filename. See nsContextMenu.js.
947 errors
["NS_ERROR_SAVE_LINK_AS_TIMEOUT"] = FAILURE(32)
948 # Used when the data from a channel has already been parsed and cached so it
949 # doesn't need to be reparsed from the original source.
950 errors
["NS_ERROR_PARSED_DATA_CACHED"] = FAILURE(33)
952 # When browser.tabs.documentchannel.parent-controlled pref and SHIP
953 # are enabled and a load gets cancelled due to another one
954 # starting, the error is NS_BINDING_CANCELLED_OLD_LOAD.
955 errors
["NS_BINDING_CANCELLED_OLD_LOAD"] = FAILURE(39)
958 # =======================================================================
959 # 25: NS_ERROR_MODULE_CONTENT
960 # =======================================================================
961 with modules
["CONTENT"]:
962 # Error codes for content policy blocking
963 errors
["NS_ERROR_CONTENT_BLOCKED"] = FAILURE(6)
964 errors
["NS_ERROR_CONTENT_BLOCKED_SHOW_ALT"] = FAILURE(7)
965 # Success variations of content policy blocking
966 errors
["NS_PROPTABLE_PROP_NOT_THERE"] = FAILURE(10)
967 # Error code for when the content process crashed
968 errors
["NS_ERROR_CONTENT_CRASHED"] = FAILURE(16)
969 # Error code for when a subframe process crashed
970 errors
["NS_ERROR_FRAME_CRASHED"] = FAILURE(14)
971 # Error code for when the content process had a different buildID than the
973 errors
["NS_ERROR_BUILDID_MISMATCH"] = FAILURE(17)
975 errors
["NS_PROPTABLE_PROP_OVERWRITTEN"] = SUCCESS(11)
976 # Error codes for FindBroadcaster in XULBroadcastManager.cpp
977 errors
["NS_FINDBROADCASTER_NOT_FOUND"] = SUCCESS(12)
978 errors
["NS_FINDBROADCASTER_FOUND"] = SUCCESS(13)
981 # =======================================================================
982 # 27: NS_ERROR_MODULE_XSLT
983 # =======================================================================
984 with modules
["XSLT"]:
985 errors
["NS_ERROR_XPATH_INVALID_ARG"] = errors
["NS_ERROR_INVALID_ARG"]
987 errors
["NS_ERROR_XSLT_PARSE_FAILURE"] = FAILURE(1)
988 errors
["NS_ERROR_XPATH_PARSE_FAILURE"] = FAILURE(2)
989 errors
["NS_ERROR_XSLT_ALREADY_SET"] = FAILURE(3)
990 errors
["NS_ERROR_XSLT_EXECUTION_FAILURE"] = FAILURE(4)
991 errors
["NS_ERROR_XPATH_UNKNOWN_FUNCTION"] = FAILURE(5)
992 errors
["NS_ERROR_XSLT_BAD_RECURSION"] = FAILURE(6)
993 errors
["NS_ERROR_XSLT_BAD_VALUE"] = FAILURE(7)
994 errors
["NS_ERROR_XSLT_NODESET_EXPECTED"] = FAILURE(8)
995 errors
["NS_ERROR_XSLT_ABORTED"] = FAILURE(9)
996 errors
["NS_ERROR_XSLT_NETWORK_ERROR"] = FAILURE(10)
997 errors
["NS_ERROR_XSLT_WRONG_MIME_TYPE"] = FAILURE(11)
998 errors
["NS_ERROR_XSLT_LOAD_RECURSION"] = FAILURE(12)
999 errors
["NS_ERROR_XPATH_BAD_ARGUMENT_COUNT"] = FAILURE(13)
1000 errors
["NS_ERROR_XPATH_BAD_EXTENSION_FUNCTION"] = FAILURE(14)
1001 errors
["NS_ERROR_XPATH_PAREN_EXPECTED"] = FAILURE(15)
1002 errors
["NS_ERROR_XPATH_INVALID_AXIS"] = FAILURE(16)
1003 errors
["NS_ERROR_XPATH_NO_NODE_TYPE_TEST"] = FAILURE(17)
1004 errors
["NS_ERROR_XPATH_BRACKET_EXPECTED"] = FAILURE(18)
1005 errors
["NS_ERROR_XPATH_INVALID_VAR_NAME"] = FAILURE(19)
1006 errors
["NS_ERROR_XPATH_UNEXPECTED_END"] = FAILURE(20)
1007 errors
["NS_ERROR_XPATH_OPERATOR_EXPECTED"] = FAILURE(21)
1008 errors
["NS_ERROR_XPATH_UNCLOSED_LITERAL"] = FAILURE(22)
1009 errors
["NS_ERROR_XPATH_BAD_COLON"] = FAILURE(23)
1010 errors
["NS_ERROR_XPATH_BAD_BANG"] = FAILURE(24)
1011 errors
["NS_ERROR_XPATH_ILLEGAL_CHAR"] = FAILURE(25)
1012 errors
["NS_ERROR_XPATH_BINARY_EXPECTED"] = FAILURE(26)
1013 errors
["NS_ERROR_XSLT_LOAD_BLOCKED_ERROR"] = FAILURE(27)
1014 errors
["NS_ERROR_XPATH_INVALID_EXPRESSION_EVALUATED"] = FAILURE(28)
1015 errors
["NS_ERROR_XPATH_UNBALANCED_CURLY_BRACE"] = FAILURE(29)
1016 errors
["NS_ERROR_XSLT_BAD_NODE_NAME"] = FAILURE(30)
1017 errors
["NS_ERROR_XSLT_VAR_ALREADY_SET"] = FAILURE(31)
1018 errors
["NS_ERROR_XSLT_CALL_TO_KEY_NOT_ALLOWED"] = FAILURE(32)
1020 errors
["NS_XSLT_GET_NEW_HANDLER"] = SUCCESS(1)
1023 # =======================================================================
1024 # 28: NS_ERROR_MODULE_IPC
1025 # =======================================================================
1026 with modules
["IPC"]:
1027 # Initial creation of a Transport object failed internally for unknown reasons.
1028 errors
["NS_ERROR_TRANSPORT_INIT"] = FAILURE(1)
1029 # Generic error related to duplicating handle failures.
1030 errors
["NS_ERROR_DUPLICATE_HANDLE"] = FAILURE(2)
1031 # Bridging: failure trying to open the connection to the parent
1032 errors
["NS_ERROR_BRIDGE_OPEN_PARENT"] = FAILURE(3)
1033 # Bridging: failure trying to open the connection to the child
1034 errors
["NS_ERROR_BRIDGE_OPEN_CHILD"] = FAILURE(4)
1037 # =======================================================================
1038 # 30: NS_ERROR_MODULE_STORAGE
1039 # =======================================================================
1040 with modules
["STORAGE"]:
1041 # To add additional errors to Storage, please append entries to the bottom
1042 # of the list in the following format:
1043 # NS_ERROR_STORAGE_YOUR_ERR, FAILURE(n)
1044 # where n is the next unique positive integer. You must also add an entry
1045 # to js/xpconnect/src/xpc.msg under the code block beginning with the
1046 # comment 'storage related codes (from mozStorage.h)', in the following
1047 # format: 'XPC_MSG_DEF(NS_ERROR_STORAGE_YOUR_ERR, "brief description of your
1049 errors
["NS_ERROR_STORAGE_BUSY"] = FAILURE(1)
1050 errors
["NS_ERROR_STORAGE_IOERR"] = FAILURE(2)
1051 errors
["NS_ERROR_STORAGE_CONSTRAINT"] = FAILURE(3)
1054 # =======================================================================
1055 # 32: NS_ERROR_MODULE_DOM_FILE
1056 # =======================================================================
1057 with modules
["DOM_FILE"]:
1058 errors
["NS_ERROR_DOM_FILE_NOT_FOUND_ERR"] = FAILURE(0)
1059 errors
["NS_ERROR_DOM_FILE_NOT_READABLE_ERR"] = FAILURE(1)
1062 # =======================================================================
1063 # 33: NS_ERROR_MODULE_DOM_INDEXEDDB
1064 # =======================================================================
1065 with modules
["DOM_INDEXEDDB"]:
1066 # IndexedDB error codes http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
1067 errors
["NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR"] = FAILURE(1)
1068 errors
["NS_ERROR_DOM_INDEXEDDB_NOT_FOUND_ERR"] = FAILURE(3)
1069 errors
["NS_ERROR_DOM_INDEXEDDB_CONSTRAINT_ERR"] = FAILURE(4)
1070 errors
["NS_ERROR_DOM_INDEXEDDB_DATA_ERR"] = FAILURE(5)
1071 errors
["NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR"] = FAILURE(6)
1072 errors
["NS_ERROR_DOM_INDEXEDDB_TRANSACTION_INACTIVE_ERR"] = FAILURE(7)
1073 errors
["NS_ERROR_DOM_INDEXEDDB_ABORT_ERR"] = FAILURE(8)
1074 errors
["NS_ERROR_DOM_INDEXEDDB_READ_ONLY_ERR"] = FAILURE(9)
1075 errors
["NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR"] = FAILURE(11)
1076 errors
["NS_ERROR_DOM_INDEXEDDB_VERSION_ERR"] = FAILURE(12)
1077 errors
["NS_ERROR_DOM_INDEXEDDB_KEY_ERR"] = FAILURE(1002)
1078 errors
["NS_ERROR_DOM_INDEXEDDB_RENAME_OBJECT_STORE_ERR"] = FAILURE(1003)
1079 errors
["NS_ERROR_DOM_INDEXEDDB_RENAME_INDEX_ERR"] = FAILURE(1004)
1082 # =======================================================================
1083 # 34: NS_ERROR_MODULE_DOM_FILEHANDLE
1084 # =======================================================================
1085 with modules
["DOM_FILEHANDLE"]:
1086 errors
["NS_ERROR_DOM_FILEHANDLE_UNKNOWN_ERR"] = FAILURE(1)
1087 errors
["NS_ERROR_DOM_FILEHANDLE_NOT_ALLOWED_ERR"] = FAILURE(2)
1088 errors
["NS_ERROR_DOM_FILEHANDLE_INACTIVE_ERR"] = FAILURE(3)
1089 errors
["NS_ERROR_DOM_FILEHANDLE_ABORT_ERR"] = FAILURE(4)
1090 errors
["NS_ERROR_DOM_FILEHANDLE_READ_ONLY_ERR"] = FAILURE(5)
1091 errors
["NS_ERROR_DOM_FILEHANDLE_QUOTA_ERR"] = FAILURE(6)
1094 # =======================================================================
1095 # 35: NS_ERROR_MODULE_SIGNED_JAR
1096 # =======================================================================
1097 with modules
["SIGNED_JAR"]:
1098 errors
["NS_ERROR_SIGNED_JAR_NOT_SIGNED"] = FAILURE(1)
1099 errors
["NS_ERROR_SIGNED_JAR_MODIFIED_ENTRY"] = FAILURE(2)
1100 errors
["NS_ERROR_SIGNED_JAR_UNSIGNED_ENTRY"] = FAILURE(3)
1101 errors
["NS_ERROR_SIGNED_JAR_ENTRY_MISSING"] = FAILURE(4)
1102 errors
["NS_ERROR_SIGNED_JAR_WRONG_SIGNATURE"] = FAILURE(5)
1103 errors
["NS_ERROR_SIGNED_JAR_ENTRY_TOO_LARGE"] = FAILURE(6)
1104 errors
["NS_ERROR_SIGNED_JAR_ENTRY_INVALID"] = FAILURE(7)
1105 errors
["NS_ERROR_SIGNED_JAR_MANIFEST_INVALID"] = FAILURE(8)
1108 # =======================================================================
1109 # 36: NS_ERROR_MODULE_DOM_FILESYSTEM
1110 # =======================================================================
1111 with modules
["DOM_FILESYSTEM"]:
1112 errors
["NS_ERROR_DOM_FILESYSTEM_INVALID_PATH_ERR"] = FAILURE(1)
1113 errors
["NS_ERROR_DOM_FILESYSTEM_INVALID_MODIFICATION_ERR"] = FAILURE(2)
1114 errors
["NS_ERROR_DOM_FILESYSTEM_NO_MODIFICATION_ALLOWED_ERR"] = FAILURE(3)
1115 errors
["NS_ERROR_DOM_FILESYSTEM_PATH_EXISTS_ERR"] = FAILURE(4)
1116 errors
["NS_ERROR_DOM_FILESYSTEM_TYPE_MISMATCH_ERR"] = FAILURE(5)
1117 errors
["NS_ERROR_DOM_FILESYSTEM_UNKNOWN_ERR"] = FAILURE(6)
1120 # =======================================================================
1121 # 38: NS_ERROR_MODULE_SIGNED_APP
1122 # =======================================================================
1123 with modules
["SIGNED_APP"]:
1124 errors
["NS_ERROR_SIGNED_APP_MANIFEST_INVALID"] = FAILURE(1)
1127 # =======================================================================
1128 # 40: NS_ERROR_MODULE_DOM_PUSH
1129 # =======================================================================
1130 with modules
["DOM_PUSH"]:
1131 errors
["NS_ERROR_DOM_PUSH_DENIED_ERR"] = FAILURE(2)
1132 errors
["NS_ERROR_DOM_PUSH_ABORT_ERR"] = FAILURE(3)
1133 errors
["NS_ERROR_DOM_PUSH_SERVICE_UNREACHABLE"] = FAILURE(4)
1134 errors
["NS_ERROR_DOM_PUSH_INVALID_KEY_ERR"] = FAILURE(5)
1135 errors
["NS_ERROR_DOM_PUSH_MISMATCHED_KEY_ERR"] = FAILURE(6)
1138 # =======================================================================
1139 # 41: NS_ERROR_MODULE_DOM_MEDIA
1140 # =======================================================================
1141 with modules
["DOM_MEDIA"]:
1142 # HTMLMediaElement API errors from
1143 # https://html.spec.whatwg.org/multipage/embedded-content.html#media-elements
1144 errors
["NS_ERROR_DOM_MEDIA_ABORT_ERR"] = FAILURE(1)
1145 errors
["NS_ERROR_DOM_MEDIA_NOT_ALLOWED_ERR"] = FAILURE(2)
1146 errors
["NS_ERROR_DOM_MEDIA_NOT_SUPPORTED_ERR"] = FAILURE(3)
1148 # HTMLMediaElement internal decoding error
1149 errors
["NS_ERROR_DOM_MEDIA_DECODE_ERR"] = FAILURE(4)
1150 errors
["NS_ERROR_DOM_MEDIA_FATAL_ERR"] = FAILURE(5)
1151 errors
["NS_ERROR_DOM_MEDIA_METADATA_ERR"] = FAILURE(6)
1152 errors
["NS_ERROR_DOM_MEDIA_OVERFLOW_ERR"] = FAILURE(7)
1153 errors
["NS_ERROR_DOM_MEDIA_END_OF_STREAM"] = FAILURE(8)
1154 errors
["NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA"] = FAILURE(9)
1155 errors
["NS_ERROR_DOM_MEDIA_CANCELED"] = FAILURE(10)
1156 errors
["NS_ERROR_DOM_MEDIA_MEDIASINK_ERR"] = FAILURE(11)
1157 errors
["NS_ERROR_DOM_MEDIA_DEMUXER_ERR"] = FAILURE(12)
1158 errors
["NS_ERROR_DOM_MEDIA_CDM_ERR"] = FAILURE(13)
1159 errors
["NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER"] = FAILURE(14)
1160 errors
["NS_ERROR_DOM_MEDIA_INITIALIZING_DECODER"] = FAILURE(15)
1161 errors
["NS_ERROR_DOM_MEDIA_REMOTE_DECODER_CRASHED_RDD_OR_GPU_ERR"] = FAILURE(16)
1162 errors
["NS_ERROR_DOM_MEDIA_REMOTE_DECODER_CRASHED_UTILITY_ERR"] = FAILURE(17)
1163 errors
["NS_ERROR_DOM_MEDIA_REMOTE_DECODER_CRASHED_MF_CDM_ERR"] = FAILURE(18)
1165 # QuotaExceededError specializations
1166 errors
["NS_ERROR_DOM_MEDIA_KEY_QUOTA_EXCEEDED_ERR"] = FAILURE(30)
1167 errors
["NS_ERROR_DOM_MEDIA_SOURCE_MAX_BUFFER_QUOTA_EXCEEDED_ERR"] = FAILURE(31)
1168 errors
["NS_ERROR_DOM_MEDIA_SOURCE_FULL_BUFFER_QUOTA_EXCEEDED_ERR"] = FAILURE(32)
1170 # Internal CDM error
1171 errors
["NS_ERROR_DOM_MEDIA_CDM_NO_SESSION_ERR"] = FAILURE(50)
1172 errors
["NS_ERROR_DOM_MEDIA_CDM_SESSION_OPERATION_ERR"] = FAILURE(51)
1174 # Internal platform-related errors
1175 errors
["NS_ERROR_DOM_MEDIA_CUBEB_INITIALIZATION_ERR"] = FAILURE(101)
1176 errors
["NS_ERROR_DOM_MEDIA_EXTERNAL_ENGINE_NOT_SUPPORTED_ERR"] = FAILURE(102)
1177 errors
["NS_ERROR_DOM_MEDIA_CDM_PROXY_NOT_SUPPORTED_ERR"] = FAILURE(103)
1178 errors
["NS_ERROR_DOM_MEDIA_DENIED_IN_NON_UTILITY"] = FAILURE(104)
1180 # =======================================================================
1181 # 42: NS_ERROR_MODULE_URL_CLASSIFIER
1182 # =======================================================================
1183 with modules
["URL_CLASSIFIER"]:
1184 # Errors during list updates
1185 errors
["NS_ERROR_UC_UPDATE_UNKNOWN"] = FAILURE(1)
1186 errors
["NS_ERROR_UC_UPDATE_DUPLICATE_PREFIX"] = FAILURE(2)
1187 errors
["NS_ERROR_UC_UPDATE_INFINITE_LOOP"] = FAILURE(3)
1188 errors
["NS_ERROR_UC_UPDATE_WRONG_REMOVAL_INDICES"] = FAILURE(4)
1189 errors
["NS_ERROR_UC_UPDATE_CHECKSUM_MISMATCH"] = FAILURE(5)
1190 errors
["NS_ERROR_UC_UPDATE_MISSING_CHECKSUM"] = FAILURE(6)
1191 errors
["NS_ERROR_UC_UPDATE_SHUTDOWNING"] = FAILURE(7)
1192 errors
["NS_ERROR_UC_UPDATE_TABLE_NOT_FOUND"] = FAILURE(8)
1193 errors
["NS_ERROR_UC_UPDATE_BUILD_PREFIX_FAILURE"] = FAILURE(9)
1194 errors
["NS_ERROR_UC_UPDATE_FAIL_TO_WRITE_DISK"] = FAILURE(10)
1195 errors
["NS_ERROR_UC_UPDATE_UNEXPECTED_VERSION"] = FAILURE(11)
1197 # Specific errors while parsing pver2/pver4 responses
1198 errors
["NS_ERROR_UC_PARSER_MISSING_PARAM"] = FAILURE(12)
1199 errors
["NS_ERROR_UC_PARSER_DECODE_FAILURE"] = FAILURE(13)
1200 errors
["NS_ERROR_UC_PARSER_UNKNOWN_THREAT"] = FAILURE(14)
1201 errors
["NS_ERROR_UC_PARSER_MISSING_VALUE"] = FAILURE(15)
1204 # =======================================================================
1205 # 43: NS_ERROR_MODULE_ERRORRESULT
1206 # =======================================================================
1207 with modules
["ERRORRESULT"]:
1208 # Represents a JS Value being thrown as an exception.
1209 errors
["NS_ERROR_INTERNAL_ERRORRESULT_JS_EXCEPTION"] = FAILURE(1)
1210 # Used to indicate that we want to throw a DOMException.
1211 errors
["NS_ERROR_INTERNAL_ERRORRESULT_DOMEXCEPTION"] = FAILURE(2)
1212 # Used to indicate that an exception is already pending on the JSContext.
1213 errors
["NS_ERROR_INTERNAL_ERRORRESULT_EXCEPTION_ON_JSCONTEXT"] = FAILURE(3)
1214 # Used to indicate that we want to throw a TypeError.
1215 errors
["NS_ERROR_INTERNAL_ERRORRESULT_TYPEERROR"] = FAILURE(4)
1216 # Used to indicate that we want to throw a RangeError.
1217 errors
["NS_ERROR_INTERNAL_ERRORRESULT_RANGEERROR"] = FAILURE(5)
1220 # =======================================================================
1221 # 51: NS_ERROR_MODULE_GENERAL
1222 # =======================================================================
1223 with modules
["GENERAL"]:
1224 # Error code used internally by the incremental downloader to cancel the
1225 # network channel when the download is already complete.
1226 errors
["NS_ERROR_DOWNLOAD_COMPLETE"] = FAILURE(1)
1227 # Error code used internally by the incremental downloader to cancel the
1228 # network channel when the response to a range request is 200 instead of
1230 errors
["NS_ERROR_DOWNLOAD_NOT_PARTIAL"] = FAILURE(2)
1231 errors
["NS_ERROR_UNORM_MOREOUTPUT"] = FAILURE(33)
1233 errors
["NS_ERROR_DOCSHELL_REQUEST_REJECTED"] = FAILURE(1001)
1234 # This is needed for displaying an error message when navigation is
1235 # attempted on a document when printing The value arbitrary as long as it
1236 # doesn't conflict with any of the other values in the errors in
1238 errors
["NS_ERROR_DOCUMENT_IS_PRINTMODE"] = FAILURE(2001)
1240 errors
["NS_SUCCESS_DONT_FIXUP"] = SUCCESS(1)
1241 # This success code may be returned by nsIAppStartup::Run to indicate that
1242 # the application should be restarted. This condition corresponds to the
1243 # case in which nsIAppStartup::Quit was called with the eRestart flag.
1244 errors
["NS_SUCCESS_RESTART_APP"] = SUCCESS(1)
1247 # raised when current pivot's position is needed but it's not in the tree
1248 errors
["NS_ERROR_NOT_IN_TREE"] = FAILURE(38)
1250 # see nsTextEquivUtils
1251 errors
["NS_OK_NO_NAME_CLAUSE_HANDLED"] = SUCCESS(34)
1253 # Error code used to indicate that functionality has been blocked by the
1255 errors
["NS_ERROR_BLOCKED_BY_POLICY"] = FAILURE(3)
1258 # ============================================================================
1259 # Write out the resulting module declarations to C++ and rust files
1260 # ============================================================================
1263 def error_list_h(output
):
1266 /* THIS FILE IS GENERATED BY ErrorList.py - DO NOT EDIT */
1268 #ifndef ErrorList_h__
1269 #define ErrorList_h__
1276 output
.write("#define NS_ERROR_MODULE_BASE_OFFSET {}\n".format(MODULE_BASE_OFFSET
))
1278 for mod
, val
in modules
.items():
1279 output
.write("#define NS_ERROR_MODULE_{} {}\n".format(mod
, val
.num
))
1282 for error
, val
in errors
.items():
1283 items
.append(" {} = 0x{:X}".format(error
, val
))
1286 enum class nsresult : uint32_t
1297 for error
, val
in errors
.items():
1298 items
.append(" {0} = nsresult::{0}".format(error
))
1306 #endif // ErrorList_h__
1313 def error_names_internal_h(output
):
1314 """Generate ErrorNamesInternal.h, which is a header file declaring one
1315 function, const char* GetErrorNameInternal(nsresult). This method is not
1316 intended to be used by consumer code, which should instead call
1317 GetErrorName in ErrorNames.h."""
1321 /* THIS FILE IS GENERATED BY ErrorList.py - DO NOT EDIT */
1323 #ifndef ErrorNamesInternal_h__
1324 #define ErrorNamesInternal_h__
1326 #include "ErrorNames.h"
1331 GetErrorNameInternal(nsresult rv)
1337 # NOTE: Making sure we don't write out duplicate values is important as
1338 # we're using a switch statement to implement this.
1340 for error
, val
in errors
.items():
1342 output
.write(' case nsresult::{0}: return "{0}";\n'.format(error
))
1347 default: return nullptr;
1349 } // GetErrorNameInternal
1353 #endif // ErrorNamesInternal_h__
1358 def error_list_rs(output
):
1361 /* THIS FILE IS GENERATED BY ErrorList.py - DO NOT EDIT */
1363 use super::nsresult;
1369 "pub const NS_ERROR_MODULE_BASE_OFFSET: nsresult = nsresult({});\n".format(
1374 for mod
, val
in modules
.items():
1376 "pub const NS_ERROR_MODULE_{}: nsresult = nsresult({});\n".format(
1381 for error
, val
in errors
.items():
1382 output
.write("pub const {}: nsresult = nsresult(0x{:X});\n".format(error
, val
))
1385 def gen_jinja(output
, input_filename
):
1386 # This is used to generate Java code for error lists, and can be expanded to
1387 # other required contexts in the future if desired.
1390 from jinja2
import Environment
, FileSystemLoader
, StrictUndefined
1392 # FileSystemLoader requires the path to the directory containing templates,
1393 # not the file name of the template itself.
1394 (path
, leaf
) = os
.path
.split(input_filename
)
1396 loader
=FileSystemLoader(path
, encoding
="utf-8"),
1397 undefined
=StrictUndefined
,
1399 tpl
= env
.get_template(leaf
)
1402 "MODULE_BASE_OFFSET": MODULE_BASE_OFFSET
,
1403 "modules": ((mod
, val
.num
) for mod
, val
in modules
.items()),
1404 "errors": errors
.items(),
1407 tpl
.stream(context
).dump(output
, encoding
="utf-8")