Search completed in 2.60 seconds.
RTCErrorEvent.error - Web APIs
the read-only rtc
errorevent property
error contains an rtc
error object describing the details of the
error which the event is announcing.
... syntax let
errorinfo = rtc
errorevent.
error; value an rtc
error object whose properties provide details about the
error which has occurred in the context of a webrtc operation.
... since rtc
error is based upon domexception, it includes those properties.
...And 16 more matches
MediaRecorderErrorEvent.error - Web APIs
the read-only
error property in the mediarecorder
errorevent interface is a domexception object providing details about the exception that was thrown by a mediarecorder instance.
... when a mediarecorder
errorevent occurs, you can determine to some extent what went wrong by examining the
error property within the mediarecorder
errorevent received by the mediarecorder's
error event handler, on
error.
... syntax
error = mediarecorder
errorevent.
error; value a domexception describing the
error represented by the event.
...And 6 more matches
SpeechRecognitionError.error - Web APIs
the
error read-only property of the speechrecognition
error interface returns the type of
error raised.
... this speechrecognition
error interface was renamed to speechrecognition
errorevent in the web speech api specification.
... syntax var my
error = event.
error; value a domstring naming the type of
error.
...And 3 more matches
SpeechRecognitionErrorEvent.error - Web APIs
the
error read-only property of the speechrecognition
errorevent interface returns the type of
error raised.
... syntax var my
error = event.
error; value a domstring naming the type of
error.
... the possible
error types are: no-speech no speech was detected.
...And 2 more matches
OverconstrainedError.OverconstrainedError() - Web APIs
the overconstrained
error constructor creates a new overconstrained
error object which indicates that the set of desired capabilities for the current mediastreamtrack cannot currently be met.
... syntax var overconstrained
error = new overconstrained
error() parameters constraint the constraint that was not satified.
... message text for the
error's message property.
... specifications specification status comment media capture and streamsthe definition of 'overconstrained
error' in that specification.
SensorErrorEvent.SensorErrorEvent() - Web APIs
the sensor
errorevent constructor creates a new sensor
errorevent object which provides information about
errors thrown by any of the interfaces based on sensor.
... syntax sensor
errorevent = new sensor
errorevent(type, {
error: domexception}); parameters type will always be 'sensor
errorevent'.
... options optional currently only one option is supported:
error: an instance of domexception.
... specifications specification status comment generic sensor apithe definition of 'sensor
errorevent' in that specification.
SpeechSynthesisErrorEvent.error - Web APIs
the
error property of the speechsynthesis
errorevent interface returns an
error code indicating what has gone wrong with a speech synthesis attempt.
... syntax my
error = event.
error; value a domstring containing an
error code.
... synthesis-unavailable the operation couldn't be completed at this time because no synthesis engine was available (for example, the user may need to install or configure a synthesis engine.) synthesis-failed the operation failed because the synthesis engine raised an
error.
... inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.on
error = function(event) { console.
error('an
error has occurred with the speech synthesis: ' + event.
error); } inputtxt.blur(); } specifications specification status comment web speech apithe definition of '
error' in that specification.
SensorErrorEvent.error - Web APIs
the
error read-only property of the sensor
errorevent interface returns the domexception object passed in the event's contructor.
... syntax var domexception = sensor
errorevent.
error; value a domexception.
... specifications specification status comment generic sensor apithe definition of '
error' in that specification.
Error codes returned by Mozilla APIs
the following tables list
errors that can occur when calling various mozilla apis.
... each
error is listed by its name and an
error code in parentheses.
... an
error will typically be displayed on the
error console, but can be captured using a try-catch block in javascript.
...And 92 more matches
NSPR Error Handling
this chapter describes the functions for retrieving and setting
errors and the
error codes set by nspr.
...
error type
error functions
error codes for information on naming conventions for nspr types, functions, and macros, see nspr naming conventions.
...
error type pr
errorcode
error functions pr_set
error pr_set
errortext pr_get
error pr_getos
error pr_get
errortextlength pr_get
errortext
error codes
error codes defined in pr
error.h: pr_out_of_memory_
error insufficient memory to perform request.
...And 67 more matches
nsIScriptError
js/xpconnect/idl/nsiscript
error.idlscriptable represents javascript
errors and warnings for use by the console service.
... 66 introduced gecko 1.0 inherits from: nsiconsolemessage last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/script
error;1.
... to create an instance, use: var script
error = components.classes["@mozilla.org/script
error;1"] .createinstance(components.interfaces.nsiscript
error); note: the nsiscript
error2 interface was merged into this interface in gecko 12.0.
...And 34 more matches
Error - JavaScript
error objects are thrown when runtime
errors occur.
... the
error object can also be used as a base object for user-defined exceptions.
... see below for standard built-in
error types.
...And 30 more matches
JSErrorReport
describes the format of a js
error that is used either by the internal
error reporting mechanism or by a user-defined
error-reporting mechanism.
... syntax js
errorreport(); properties name type description filename const char * indicates the source file or url that produced the
error condition.
... if null, the
error is local to the script in the current html page.
...And 24 more matches
DOMError - Web APIs
the dom
error interface describes an
error object that contains an
error name.
... properties dom
error.name read only returns a domstring representing one of the
error type names (see below).
... dom
error.message read only returns a domstring representing a message or description associated with the given
error type name.
...And 19 more matches
WebAssembly.CompileError - JavaScript
the webassembly.compile
error object indicates an
error during webassembly decoding or validation.
... constructor webassembly.compile
error() creates a new webassembly.compile
error object.
... instance properties webassembly.compile
error.prototype.message
error message.
...And 19 more matches
WebAssembly.LinkError - JavaScript
the webassembly.link
error object indicates an
error during module instantiation (besides traps from the start function).
... constructor webassembly.link
error() creates a new webassembly.link
error object.
... instance properties webassembly.link
error.prototype.message
error message.
...And 19 more matches
WebAssembly.RuntimeError - JavaScript
the webassembly.runtime
error object is the
error type that is thrown whenever webassembly specifies a trap.
... constructor webassembly.runtime
error() creates a new webassembly.runtime
error object.
... instance properties webassembly.runtime
error.prototype.message
error message.
...And 19 more matches
JS_ReportErrorNumber
report an
error with an application-defined
error code.
... syntax void js_report
errornumber(jscontext *cx, js
errorcallback
errorcallback, void *userref, const unsigned
errornumber, ...); void js_report
errornumberuc(jscontext *cx, js
errorcallback
errorcallback, void *userref, const unsigned
errornumber, ...); bool js_report
errorflagsandnumber(jscontext *cx, unsigned flags, js
errorcallback
errorcallback, void *userref, const unsigned
errornumber, ...); bool js_report
errorflagsandnumberuc(jscontext *cx, unsigned flags, js
errorcallback
errorcallback, void *userref, const unsigned
errornumber, ...); void js_report
errornumberucarray(jscontext *cx, js
errorcallback
errorcallback, ...
... void *userref, const unsigned
errornumber, const char16_t **args); // added in spidermonkey 19 name type description cx jscontext * the context in which to report the
error.
...And 18 more matches
GlobalEventHandlers.onerror - Web APIs
the on
error property of the globaleventhandlers mixin is an eventhandler that processes
error events.
...
error events are fired at various targets for different kinds of
errors: when a javascript runtime
error (including syntax
errors and exceptions thrown within handlers) occurs, an
error event using interface
errorevent is fired at window and window.on
error() is invoked (as well as handlers attached by window.addeventlistener (not only capturing)).
... when a resource (such as an <img> or <script>) fails to load, an
error event using interface event is fired at the element that initiated the load, and the on
error() handler on the element is invoked.
...And 17 more matches
nsIErrorService
xpcom/base/nsi
errorservice.idlscriptable this is a service that allows nsresult codes to be mapped to string bundles that can be used to look up
error messages.
... inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/xpcom/
error-service;1 method overview string get
errorstringbundle(in short
errormodule); string get
errorstringbundlekey(in nsresult
error); void register
errorstringbundle(in short
errormodule, in string stringbundleurl); void register
errorstringbundlekey(in nsresult
error, in string stringbundlekey); void unregister
errorstringbundle(in short
errormodule); void unregister
errorstringbundlekey(in nsresult
error); methods get
errorstringbundle() retrieves a string bundle url for an
error module.
... string get
errorstringbundle( in short
errormodule ); parameters
errormodule the module for which the string bundle is registered.
...And 16 more matches
RTCError - Web APIs
the rtc
error interface describes an
error which has occurred while handling webrtc operations.
... it's based upon the standard domexception interface that describes general dom
errors.
... constructor rtc
error() creates and returns a new rtc
error object initialized with the properties of the provided rtc
errorinit dictionary and, optionally, a string to use as the value of the
error's message property.
...And 16 more matches
IDBRequest.error - Web APIs
the
error read-only property of the idbrequest interface returns the
error in the event of an unsuccessful request.
... syntax var my
error = request.
error; value a dom
error containing the relevant
error.
... in chrome 48+/firefox 58+ this property returns a domexception because dom
error has been removed from the dom standard.
...And 15 more matches
EvalError - JavaScript
the eval
error object indicates an
error regarding the global eval() function.
... this exception is not thrown by javascript anymore, however the eval
error object remains for compatibility.
... constructor eval
error() creates a new eval
error object.
...And 14 more matches
TypeError - JavaScript
the type
error object represents an
error when an operation could not be performed, typically (but not exclusively) when a value is not of the expected type.
... a type
error may be thrown when: an operand or argument passed to a function is incompatible with the type expected by that operator or function; or when attempting to modify a value that cannot be changed; or when attempting to use a value in an inappropriate way.
... constructor type
error() creates a new type
error object.
...And 14 more matches
JS_SetErrorReporter
get or specify the
error reporting mechanism for an application.
... syntax js
errorreporter js_get
errorreporter(jsruntime *rt); js
errorreporter js_set
errorreporter(jsruntime *rt, js
errorreporter er); name type description cx jsruntime * pointer to a js runtime whose
errors should be reported via your function.
... er js
errorreporter the user-defined
error reporting function to use in your application, described below.
...And 13 more matches
AddressErrors - Web APIs
the address
errors dictionary is used by the payment request api to to report validation
errors in a physical address (typically a billing address or a shipping address).
... any members which is present indicates that a validation
error occurred for the member of the same name in an address described using paymentaddress.
... address
errors is the type of the object returned by shippingaddress
errors in the paymentdetailsupdate passed into paymentrequestupdateevent.updatewith() by the shippingaddresschange event handler if a change to the address resulted in a validation
error occurring.
...And 13 more matches
RangeError - JavaScript
the range
error object indicates an
error when a value is not in the set or range of allowed values.
... description a range
error is thrown when trying to pass a value as an argument to a function that does not allow a range that includes the value.
... constructor range
error() creates a new range
error object.
...And 13 more matches
ReferenceError - JavaScript
the reference
error object represents an
error when a non-existent variable is referenced.
... constructor reference
error() creates a new reference
error object.
... instance properties reference
error.prototype.message
error message.
...And 13 more matches
SyntaxError - JavaScript
the syntax
error object represents an
error when trying to interpret syntactically invalid code.
... constructor syntax
error() creates a new syntax
error object.
... instance properties syntax
error.prototype.message
error message.
...And 13 more matches
URIError - JavaScript
the uri
error object represents an
error when a global uri handling function was used in a wrong way.
... constructor uri
error() creates a new uri
error object.
... instance properties uri
error.prototype.message
error message.
...And 13 more matches
RTCDataChannel: error event - Web APIs
a webrtc
error event is sent to an rtcdatachannel object's on
error error handler when an
error occurs on the data channel.
... bubbles yes cancelable no interface rtc
errorevent event handler property on
error the rtc
errorevent object provides details about the
error that occurred; see that article for details.
... examples // strings for each of the sctp cause codes found in rfc // 4960, section 3.3.10: // https://tools.ietf.org/html/rfc4960#section-3.3.10 const sctpcausecodes = [ "no sctp
error", "invalid stream identifier", "missing mandatory parameter", "stale cookie
error", "sender is out of resource (i.e., memory)", "unable to resolve address", "unrecognized sctp chunk type received", "invalid mandatory parameter", "unrecognized parameters", "no user data (sctp data chunk has no data)", "cookie received while shutting down", "restart of an association with new addresses", "user-initiated abort", "protocol violation" ]; dc.addeventlistener("
error", ev => { const err = ev.
error; console.
error("webrtc
error: ", err.message); // handle specific
error detail types...
...And 12 more matches
InternalError - JavaScript
the internal
error object indicates an
error that occurred internally in the javascript engine.
... constructor internal
error() creates a new internal
error object.
... instance properties internal
error.prototype.message
error message.
...And 12 more matches
FileError - Web APIs
represents an
error that occurs while using the filereader interface.
...use the new dom4 dom
error interface instead.
... in the file system api, a file
error represents
error conditions that you might encounter while accessing the file system using the asynchronous api.
...And 10 more matches
MediaRecorder.onerror - Web APIs
the mediarecorder interface's on
error event handler is called by the mediastream recording api when an
error occurs.
... you can provide an event handler to deal with
errors that occur while creating or using a media recorder.
... the
error object is of type mediarecorder
errorevent, and its
error property contains a domexception object that describes the
error that occurred.
...And 10 more matches
JavaScript error reference - JavaScript
below, you'll find a list of
errors which are thrown by javascript.
... these
errors can be a helpful debugging aid, but the reported problem isn't always immediately clear.
... the pages below will provide additional details about these
errors.
...And 10 more matches
Error Console - Archive of obsolete content
the
error console is deprecated in firefox, and is now only made available if you set the devtools.
errorconsole.enabled preference to true.
... the
error console is a tool available in most mozilla-based applications that is used for reporting
errors in the application chrome and in web pages user opens.
... it reports javascript-related
errors and warnings, css
errors and arbitrary messages from chrome code.
...And 9 more matches
Error.number - Archive of obsolete content
the
error.number property returns or sets the numeric value associated with a specific
error.
... the
error object's default property is number.
... syntax object .number [=
errornumber] parameters object any instance of the
error object.
...And 9 more matches
JS::CreateError
this article covers features introduced in spidermonkey 38 create an
error object.
... syntax // added in spidermonkey 45 bool js::create
error(jscontext *cx, jsexntype type, handleobject stack, handlestring filename, uint32_t linenumber, uint32_t columnnumber, js
errorreport *report, handlestring message, mutablehandlevalue rval); // obsolete since jsapi 39 bool js::create
error(jscontext *cx, jsexntype type, handlestring stack, handlestring filename, uint32_t linenumber, uint32_t columnnumber, js
errorreport *report, handlestring message, mutablehandlevalue rval); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... stack js::handlestring or js::handleobject the value of
error.prototype.stack.
...And 9 more matches
nsIScriptError2
js/src/xpconnect/idl/nsiscript
error.idlscriptable represents javascript
errors and warnings for use by the console service; augments nsiscript
error by adding a way to initialize the
error with the window id of the outer window with which the
error is associated.
... 1.0 66 introduced gecko 2.0 obsolete gecko 12.0 inherits from: nsiscript
error last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) in gecko 12.0 this interface was merged into the nsiscript
error interface.
... method overview void initwithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid); attributes attribute type description innerwindowid unsigned long long the inner window id with which the
error is associated.
...And 9 more matches
RTCPeerConnection: icecandidateerror event - Web APIs
the webrtc api event icecandidate
error is sent to an rtcpeerconnection if an
error occurs while performing ice negotiations through a stun or turn server.
... the event object is of type rtcpeerconnectionice
errorevent, and contains information describing the
error in some amount of detail.
... bubbles no cancelable no interface rtcpeerconnectionice
errorevent event handler property rtcpeerconnection.onicecandidate
error description the
error object's
errorcode property is one of the numeric stun
error codes.
...And 9 more matches
Control flow and error handling - JavaScript
while it is common to throw numbers or strings as
errors, it is frequently more effective to use one of the exception types specifically created for this purpose: ecmascript exceptions domexception and dom
error throw statement use the throw statement to throw an exception.
...the following code throws several exceptions of varying types: throw '
error2'; // string type throw 42; // number type throw true; // boolean type throw {tostring: function() { return "i'm an object!"; } }; note: you can specify an object when you throw an exception.
... // create an object type userexception function userexception(message) { this.message = message; this.name = 'userexception'; } // make the exception convert to a pretty string when used as a string // (e.g., by the
error console) userexception.prototype.tostring = function() { return `${this.name}: "${this.message}"`; } // create an instance of the object type and throw it throw new userexception('value too high'); try...catch statement the try...catch statement marks a block of statements to try, and specifies one or more responses should an exception be thrown.
...And 9 more matches
OS.File.Error
instances of os.file.
error are used by os.file to notify of file-related
errors.
... using os.file.
error example: finding out whether the problem is due to a file that does not exist try { let file = os.file.open("myfile.txt"); // ...
... } catch (ex) { if (ex instanceof os.file.
error && ex.becausenosuchfile) { // the file does not exist } } global object os.file.
error methods overview the following functions are utility functions that may be used to construct instances of os.file.
error, setting the platform-specific
error number.
...And 8 more matches
JS_ReportError
create a formatted
error or warning message to pass to a user-defined
error reporting function.
... syntax void js_report
error(jscontext *cx, const char *format, ...); bool js_reportwarning(jscontext *cx, const char *format, ...); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... format const char * format string to convert into an
error message using js_vsmprintf.
...And 8 more matches
ErrorEvent - Web APIs
the
errorevent interface represents events providing information related to
errors in scripts or in files.
...75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/
errorevent" target="_top"><rect x="116" y="1" width="100" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="166" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">
errorevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties also inherits prope...
...
errorevent.message read only is a domstring containing a human-readable
error message describing the problem.
...And 8 more matches
IDBTransaction.error - Web APIs
the idbtransaction.
error property of the idbtransaction interface returns one of several types of
error when there is an unsuccessful transaction.
... syntax var my
error = transaction.
error; value a dom
error containing the relevant
error.
... in chrome 48+/firefox 58+ this property returns a domexception because dom
error has been removed from the dom standard.
...And 8 more matches
RTCPeerConnectionIceErrorEvent - Web APIs
the rtcpeerconnectionice
errorevent interface—based upon the event interface—provides details pertaining to an ice
error announced by sending an icecandidate
error event to the rtcpeerconnection object.
... constructor rtcpeerconnectionice
errorevent() creates and returns a new rtcpeerconnectionice
errorevent object, with its type and other properties initialized as specified in the parameters.
... properties the rtcpeerconnectionice
errorevent interface includes the properties found on the event interface, as well as the following properties: address read only a domstring providing the local ip address used to communicate with the stun or turn server being used to negotiate the connection, or null if the local ip address has not yet been exposed as part of a local ice candidate.
...And 8 more matches
MediaError.message - Web APIs
the read-only property media
error.message returns a domstring which contains a human-readable string offering specific diagnostic details related to the
error described by the media
error object, or an empty string ("") if no diagnostic information can be determined or provided.
... syntax var
errormessage = media
error.message; value a domstring providing a detailed, specific explanation of what went wrong and possibly how it might be fixed.
... this is not simply a generic description of the media
error.code property's value, but instead goes deeper into the specifics of this particular
error and its circumstances.
...And 7 more matches
RTCIdentityErrorEvent - Web APIs
the rtcidentity
errorevent interface represents an
error associated with the identity provider (idp).
...two events are sent with this type: idpassertion
error and idpvalidation
error.
... firefox implements this interface under the following name: rtcpeerconnectionidentity
errorevent.
...And 7 more matches
WebGLRenderingContext.getError() - Web APIs
the webglrenderingcontext.get
error() method of the webgl api returns
error information.
... syntax glenum gl.get
error(); parameters none.
... return value constant description gl.no_
error no
error has been recorded.
...And 7 more matches
Network Error Logging - HTTP
network
error logging is a mechanism that can be configured via the nel http response header.
... the following object keys can be specified in the nel header: report_to the reporting api group to send network
error reports to (see below).
... the reporting group referenced above is defined in the usual manner within the report-to header, for example: report-to: { "group": "nel", "max_age": 31556952, "endpoints": [ { "url": "https://example.com/csp-reports" } ] }
error reports in these examples, the entire reporting api payload is shown.
...And 7 more matches
Error() constructor - JavaScript
the
error constructor creates an
error object.
... syntax new
error([message[, filename[, linenumber]]]) parameters messageoptional a human-readable description of the
error.
... filename optional the value for the filename property on the created
error object.
...And 7 more matches
MediaError.code - Web APIs
the read-only property media
error.code returns a numeric value which represents the kind of
error that occurred on a media element.
... to get a text string with specific diagnostic information, see media
error.message.
... syntax var my
error = media
error.code; value a numeric value indicating the general type of
error which occurred.
...And 6 more matches
PaymentValidationErrors - Web APIs
the paymentvalidation
errors dictionary represents objects providing information about any and all
errors that occurred while processing a payment request.
... when validation of the paymentresponse returned by the paymentrequest.show() or paymentresponse.retry() methods fails, your code creates a paymentvalidation
errors object to pass into retry() so that the user agent knows what needs to be fixed and what if any
error messages to display to the user.
... properties
error optional a general description of a payment
error from which the user may attempt to recover by retrying the payment, possibly after correcting mistakes in the payment information.
...And 6 more matches
RTCDataChannel.onerror - Web APIs
the rtcdatachannel.on
error property is an eventhandler which specifies a function to be called when the
error event is received.
... when an
error occurs on the data channel, the function receives as input an
errorevent object describing the
error which occurred.
... syntax rtcdatachannel.on
error = function; value a function which the browser will call to handle the
error event when it occurs on the data channel.
...And 6 more matches
PRErrorCode
type for
error codes that can be retrieved with pr_get
error.
... you can also set your own
errors using pr_set
error.
... syntax #include <pr
error.h> typedef print32 pr
errorcode description the service nspr offers in this area is the ability to associate a thread-specific condition with an
error number.
...And 5 more matches
IDBRequest.onerror - Web APIs
the on
error event handler of the idbrequest interface handles the
error event, fired when a request returns an
error.
... the event handler takes one parameter, an
error event with type="
error".
... syntax request.on
error = function(event) { ...
...And 5 more matches
MediaRecorderErrorEvent() - Web APIs
the mediarecorder
errorevent() constructor creates a new mediarecorder
errorevent object that represents an
error that occurred during the recording of media by the mediastream recording api.
... in general, you won't create these yourself; they are delivered to your implementation of mediarecorder.on
error when
errors occur while recording media.
... syntax var
errorevent = new mediarecorder
errorevent(
errorinfo) parameters
errorinfo an object describing the
error object to be created.
...And 5 more matches
RTCPeerConnection.onicecandidateerror - Web APIs
the rtcpeerconnection.onicecandidate
error property is an eventhandler which specifies a function which is called to handle the icecandidate
error event when it occurs on an rtcpeerconnection instance.
... this event is fired when an
error occurs during the ice candidate gathering process.
... syntax rtcpeerconnection.onicecandidate
error = eventhandler; value this should be set to a function you provide which is passed a single parameter: an rtcpeerconnectionice
errorevent object describing the icecandidate
error event.
...And 5 more matches
CORS errors - HTTP
in these pages, we'll look into some common cors
error messages and how to resolve them.
... if the cors configuration isn't setup correctly, the browser console will present an
error like "cross-origin request blocked: the same origin policy disallows reading the remote resource at $somesite" indicating that the request was blocked due to violating the cors security rules.
... now try to reproduce the failing transaction and check the console if you are seeing a cors violation
error message.
...And 5 more matches
Error.prototype.stack - JavaScript
the non-standard stack property of
error objects offer a trace of which functions were called, in what order, from which line and file, and with what arguments.
... description each step will be separated by a newline, with the first part of the line being the function name (if not a call from the global scope), then by an at (@) sign, the file location (except when the function is the
error constructor as the
error is being thrown), a colon, and, if there is a file location, the line number.
... (note that the
error object also possesses the filename, linenumber and columnnumber properties for retrieving these from the
error thrown (but only the
error, and not its trace).) note that this is the format used by firefox.
...And 5 more matches
getLastError - Archive of obsolete content
getlast
error returns the most recent nonzero
error code.
... method of install object syntax int getlast
error (); parameters none.
... returns the most recent nonzero
error code.
...And 4 more matches
Error.description - Archive of obsolete content
the
error.description property returns or sets the descriptive string associated with a specific
error.
...any instance of an
error object.
...a string expression containing a description of the
error.
...And 4 more matches
mozIStorageError
the mozistorage
error interface represents
errors returned by the storage api, offering attributes to obtain the
error code as well as a human-readable
error message corresponding to the
error that occurred.
... storage/public/mozistorage
error.idlscriptable please add a summary to this article.
... last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports attributes attribute type description message autf8string a human readable
error string with details; this may be null if no details are available.
...And 4 more matches
GeolocationPositionError - Web APIs
the geolocationposition
error interface represents the reason of an
error occurring when using the geolocating device.
... properties the geolocationposition
error interface doesn't inherit any property.
... geolocationposition
error.code read only secure context returns an unsigned short representing the
error code.
...And 4 more matches
IDBDatabase.onerror - Web APIs
the on
error event handler of the idbdatabase interface handles the
error event, fired when a request returns an
error and bubbles up to the connection object.
... syntax idbdatabase.on
error = function(event) { ...
... } example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes on
error and onabort functions to handle non-success cases.
...And 4 more matches
IDBTransaction.onerror - Web APIs
the on
error event handler of the idbtransaction interface handles the
error event, fired when a request returns an
error and bubbles up to the transaction object.
... syntax transaction.on
error = function(event) { ...
...note the transaction.on
error = function(event) { }; block, making use of transaction.
error to help in reporting what went wrong when the transaction was unsuccessful.
...And 4 more matches
MediaError - Web APIs
the media
error interface represents an
error which occurred while handling media in an html media element based on htmlmediaelement, such as <audio> or <video>.
... a media
error object describes the
error in general terms using a numeric code categorizing the kind of
error, and a message, which provides specific diagnostics about what went wrong.
... media
error.code a number which represents the general type of
error that occurred, as follows: name value description media_err_aborted 1 the fetching of the associated resource was aborted by the user's request.
...And 4 more matches
RTCErrorEvent - Web APIs
the webrtc api's rtc
errorevent interface represents an
error sent to a webrtc object.
... it's based on the standard event interface, but adds rtc-specific information describing the
error, as shown below.
... constructor rtc
errorevent() creates and returns a new rtc
errorevent object.
...And 4 more matches
SyntaxError: JSON.parse: bad parsing - JavaScript
message syntax
error: json.parse: unterminated string literal syntax
error: json.parse: bad control character in string literal syntax
error: json.parse: bad character in string literal syntax
error: json.parse: bad unicode escape syntax
error: json.parse: bad escape character syntax
error: json.parse: unterminated string syntax
error: json.parse: no number after minus sign syntax
error: json.parse: unexpected non-digit syntax
error: json.parse: missing digits after decimal point syntax
error: json.parse: unterminated fractional number syntax
error: json.parse: missing digits after exponent indicator syntax
error: json.parse: missing digits after exponent sign syntax
error: json.parse: exponent part is missing...
... a number syntax
error: json.parse: unexpected end of data syntax
error: json.parse: unexpected keyword syntax
error: json.parse: unexpected character syntax
error: json.parse: end of data while reading object contents syntax
error: json.parse: expected property name or '}' syntax
error: json.parse: end of data when ',' or ']' was expected syntax
error: json.parse: expected ',' or ']' after array element syntax
error: json.parse: end of data when property name was expected syntax
error: json.parse: expected double-quoted property name syntax
error: json.parse: end of data after property name when ':' was expected syntax
error: json.parse: expected ':' after property name in object syntax
error: json.parse: end of data after property value in object syntax
error: json.parse: expected ',' or '}' after propert...
...y value in object syntax
error: json.parse: expected ',' or '}' after property-value pair in object literal syntax
error: json.parse: property names must be double-quoted strings syntax
error: json.parse: expected property name or '}' syntax
error: json.parse: unexpected character syntax
error: json.parse: unexpected non-whitespace character after json data syntax
error: json.parse
error: invalid character at position {0} (edge)
error type syntax
error what went wrong?
...And 4 more matches
AggregateError - JavaScript
the aggregate
error object represents an
error when several
errors need to be wrapped in a single
error.
... it is thrown when multiple
errors need to be reported by an operation, for example by promise.any(), when all promises passed to it reject.
... constructor aggregate
error() creates a new aggregate
error object.
...And 4 more matches
PR_SetErrorText
sets the text associated with an
error.
... syntax #include <pr
error.h> void pr_set
errortext(printn textlength, const char *text) parameters the function has these parameters: textlength the length of the text in the text.
... text the text to associate with the
error.
...And 3 more matches
JS_ErrorFromException
get or create js
errorreport from an exception object.
... syntax js
errorreport * js_
errorfromexception(jscontext *cx, js::handleobject obj); name type description cx jscontext * pointer to a js context whose
errors should be reported via your function.
... other contexts in the same runtime can have their own
error reporting functions.
...And 3 more matches
Components.utils.reportError
components.utils.report
error reports a javascript
error object to the
error console, and returns.
...if it is not a javascript
error object, the parameter is converted to a string and reported as a new
error.
... this means you can use components.utils.report
error to report debugging messages to the
error console, just like dump() can be used to print messages to the native console.
...And 3 more matches
Source map errors - Firefox Developer Tools
general source map
error reporting if you do see a problem, a message will appear in the webconsole.
... this message will show an
error message, the resource url, and the source map url: here, the resource url tells us that bundle.js mentions a source map, and the source map url tells us where to find the source map data (in this case, relative to the resource).
... the
error tells us that the source map is not json data — so we're serving the wrong file.
...And 3 more matches
AddressErrors.addressLine - Web APIs
an object based on address
errors includes an addressline property when validation of the address finds one or more
errors in the array of strings in the address's addressline.
... the returned string explains the
error and should offer suggestions for how to correct it.
... syntax var addressline
error = address
errors.addressline; value if an
error occurred during validation of the address due to one of the strings in the addressline array having an invalid value, this property is set to a domstring providing a human-readable
error message explaining the validation
error.
...And 3 more matches
HTMLMediaElement.error - Web APIs
the htmlmediaelement.
error is the media
error object for the most recent
error, or null if there has not been an
error.
... when an
error event is received by the element, you can determine details about what happened by examining this object.
... syntax var my
error = htmlmediaelement.
error; value a media
error object describing the most recent
error to occur on the media element or null if no
errors have occurred.
...And 3 more matches
HTMLMediaElement.onerror - Web APIs
the on
error property of the htmlmediaelement interface is the eventhandler for processing
error events.
... the
error event fires when some form of
error occurs while attempting to load or perform the media.
... syntax htmlmediaelement.on
error = eventlistener; value a function which serves as the event handler for the
error event.
...And 3 more matches
OverconstrainedError - Web APIs
the overconstrained
error interface of the media capture and streams api indicates that the set of desired capabilities for the current mediastreamtrack cannot currently be met.
... constructor overconstrained
error.overconstrained
error() creates a new overconstrained
error object.
... properties overconstrained
error.constraint read only returns the constraint that was supplied in the constructor, meaning the constraint that was not satisfied.
...And 3 more matches
PayerErrors.email - Web APIs
the email property is included in a payer
errors object if the paymentresponse.payeremail property failed validation; in this case, the property should contain a string describing how to correct the problem.
... if the payer's email address passed validation, this property is not included in the payer
errors object.
... syntax payeremail = payer
errors.email; value if validation of the payer's email address (paymentresponse.payeremail) found problems, this property should be set to a domstring that explains the validation problem and how to correct it.
...And 3 more matches
PayerErrors.name - Web APIs
the name property is included in a payer
errors object if the payername returned in the response couldn't be validated.
...if the payer's name validated successfully, the name property is omitted from the payer
errors object.
... syntax payername = payer
errors.name; value if this property is present in the payer
errors object, the payer's name couldn't be successfully validated, and the name property's value is a domstring explaining the
error.
...And 3 more matches
PayerErrors.phone - Web APIs
the phone property is found in a payer
errors object if the payername returned in the response couldn't be validated as a valid phone number.
...if the payer's phone number validated successfully, the phone property is omitted from the payer
errors object.
... syntax payerphone = payer
errors.phone; value if this property is present in the payer
errors object, the payer's phone number couldn't be successfully validated, and the phone property's value is a domstring explaining the
error.
...And 3 more matches
PayerErrors - Web APIs
the payer
errors dictionary is used by the payment request api to indicate the presence of—and to explain how to correct—validation
errors in the payer details.
... for each field in the payment information that fails validation, the payer
errors object contains a string explaining the
error.
... properties email optional if present, this domstring is a string describing the validation
error from which the payer's email address—as given by paymentresponse.payeremail—currently suffers.
...And 3 more matches
RTCPeerConnection.onidpassertionerror - Web APIs
the rtcpeerconnection.onidpassertion
error event handler is a property containing the code to execute whent the idpassertion
error event, of type rtcidentity
errorevent, is received by this rtcpeerconnection.
... such an event is sent when the associated identity provider (idp) encounters an
error while generating an identity assertion.
...you should instead detect idp assertion
errors by handling rejection of the promise returned by rtcpeerconnection.peeridentity.
...And 3 more matches
RTCPeerConnection.onidpvalidationerror - Web APIs
the rtcpeerconnection.onidpvalidation
error event handler is a property containing the code to execute whent the idpvalidation
error event, of type rtcidentity
errorevent, is received by this rtcpeerconnection.
... such an event is sent when the associated identity provider (idp) encounters an
error while validating an identity assertion.
...you should instead detect idp validation
errors by watching for the promise returned by rtcpeerconnection.peeridentity to be rejected.
...And 3 more matches
ReadableStreamDefaultController.error() - Web APIs
the
error() method of the readablestreamdefaultcontroller interface causes any future interactions with the associated stream to
error.
... note: the
error() method can be called more than once, and can be called when the stream is not readable.
... syntax readablestreamdefaultcontroller.
error(e); parameters e the
error you want future interactions to fail with.
...And 3 more matches
Response.error() - Web APIs
the
error() method of the response interface returns a new response object associated with a network
error.
... note: this is mainly relevant to serviceworkers; the
error method is used to return an
error if you so wish it.
... an
error response has its type set to
error.
...And 3 more matches
SpeechRecognitionError - Web APIs
the speechrecognition
error interface of the web speech api represents
error messages from the recognition service.
... this speechrecognition
error interface was renamed to speechrecognition
errorevent in the web speech api specification.
... properties speechrecognition
error also inherits properties from its parent interface, event.
...And 3 more matches
SyntaxError: applying the 'delete' operator to an unqualified name is deprecated - JavaScript
message syntax
error: calling delete on expression not allowed in strict mode (edge) syntax
error: applying the 'delete' operator to an unqualified name is deprecated (firefox) syntax
error: delete of an unqualified identifier in strict mode.
... (chrome)
error type syntax
error in strict mode only.
...in strict mode, an attempt to delete a variable will throw an
error and is not allowed.
...And 3 more matches
SyntaxError: missing ; before statement - JavaScript
message syntax
error: expected ';' (edge) syntax
error: missing ; before statement (firefox)
error type syntax
error.
... however, oftentimes, this
error is only a consequence of another
error, like not escaping strings properly, or using var wrongly.
...carefully check the syntax when this
error is thrown.
...And 3 more matches
Error.prototype.toSource() - JavaScript
the tosource() method returns code that could eval to the same
error.
... syntax e.tosource() return value a string containing the source code of the
error.
... examples using tosource calling the tosource method of an
error instance (including native
errors) will return a string containing the source code of the
error.
...And 3 more matches
Error.prototype.toString() - JavaScript
the tostring() method returns a string representing the specified
error object.
... syntax e.tostring() return value a string representing the specified
error object.
... description the
error object overrides the object.prototype.tostring() method inherited by all objects.
...And 3 more matches
EvalError() constructor - JavaScript
the eval
error constructor creates a new
error regarding the global eval() function.
... this exception is not thrown by javascript anymore, however the eval
error object remains for compatibility.
... syntax new eval
error([message[, filename[, linenumber]]]) parameters message optional.
...And 3 more matches
WebAssembly.LinkError() constructor - JavaScript
the webassembly.link
error() constructor creates a new webassembly link
error object, which indicates an
error during module instantiation (besides traps from the start function).
... syntax new webassembly.link
error(message, filename, linenumber) parameters message optional human-readable description of the
error.
... examples creating a new link
error instance the following snippet creates a new link
error instance, and logs its details to the console: try { throw new webassembly.link
error('hello', 'somefile', 10); } catch (e) { console.log(e instanceof link
error); // true console.log(e.message); // "hello" console.log(e.name); // "link
error" console.log(e.filename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications ...
...And 3 more matches
WebAssembly.RuntimeError() constructor - JavaScript
the webassembly.runtime
error() constructor creates a new webassembly runtime
error object — the type that is thrown whenever webassembly specifies a trap.
... syntax new webassembly.runtime
error(message, filename, linenumber) parameters message optional human-readable description of the
error.
... examples creating a new runtime
error instance the following snippet creates a new runtime
error instance, and logs its details to the console: try { throw new webassembly.runtime
error('hello', 'somefile', 10); } catch (e) { console.log(e instanceof runtime
error); // true console.log(e.message); // "hello" console.log(e.name); // "runtime
error" console.log(e.filename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } spe...
...And 3 more matches
<merror> - MathML
the mathml <m
error> element is used to display contents as
error messages.
... in firefox this
error message is rendered similar to the typical xml
error message.
... note that this
error is not thrown when your mathml markup is wrong or not well-formed xml.
...And 3 more matches
resetError - Archive of obsolete content
reset
error resets a saved
error code to zero.
... method of install object syntax void reset
error (); parameters none.
...description the reset
error method resets any saved
error code to zero.
...And 2 more matches
Error.stackTraceLimit - Archive of obsolete content
the
error.stacktracelimit property gets or sets the stack trace limit, which is equivalent to the number of
error frames to display.
... syntax
error.stacktracelimit remarks you can set the stacktracelimit property to any positive value between 0 and infinity.
... if the stacktracelimit property is set to 0 at the time an
error is thrown, no stack trace is shown.
...And 2 more matches
DownloadError
a download
error object provides detailed information about a download failure.
... properties attribute type description result read only nsresult the result code associated with this
error.
... becausesourcefailed read only boolean indicates an
error occurred while reading from the remote location.
...And 2 more matches
PR_GetOSError
returns the current thread's last set os-specific
error code.
... syntax #include <pr
error.h> print32 pr_getos
error(void) returns the value returned is a 32-bit signed number.
... description used for platform-specific code that requires the underlying os
error.
...And 2 more matches
PR_SetError
sets
error information within a thread context.
... syntax #include <pr
error.h> void pr_set
error(pr
errorcode
errorcode, print32 oserr) parameters the function has these parameters:
errorcode the nspr (platform-independent) translation of the
error.
... oserr the platform-specific
error.
...And 2 more matches
JSErrorFormatString
this article covers features introduced in spidermonkey 17 represent
error message and type.
... syntax typedef struct js
errorformatstring { const char *format; uint16_t argcount; int16_t exntype; } js
errorformatstring; name type description format const char * the
error format string in ascii.
... argcount uint16_t the number of arguments to expand in the formatted
error message.
...And 2 more matches
JS_GetErrorPrototype
this article covers features introduced in spidermonkey 38 return the original value of
error.prototype.
... syntax jsobject * js_get
errorprototype(jscontext *cx); name type description cx jscontext * pointer to a js context whose
errors should be reported via your function.
... other contexts in the same runtime can have their own
error reporting functions.
...And 2 more matches
nsIDOMGeoPositionError
the nsidomgeoposition
error interface represents an
error that occurred while performing geolocation operations.
... dom/interfaces/geolocation/nsidomgeoposition
error.idlscriptable please add a summary to this article.
... last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports attributes attribute type description code short numerical
error code; see
error constants for a complete list.
...And 2 more matches
nsISSLErrorListener
security/manager/ssl/public/nsissl
errorlistener.idlscriptable a mechanism to report a broken ssl connection.
...method overview boolean notifyssl
error(in nsiinterfacerequestor socketinfo, in print32
error, in autf8string targetsite); methods notifyssl
error() called in case of an ssl
error.
... boolean notifyssl
error( in nsiinterfacerequestor socketinfo, in print32
error, in autf8string targetsite ); parameters socketinfo a network communication context that can be used to obtain more information about the active connection.
...And 2 more matches
AddressErrors.city - Web APIs
an object based on address
errors includes a city property when validation of the address fails for the value given for the address's city property.
... the returned string explains the
error and should offer suggestions for how to correct it.
... syntax var city
error = address
errors.city; value if the value specified in the paymentaddress object's city property could not be validated, this property contains a domstring offering a human-readable explanation of the validation
error and offers suggestions for correcting it.
...And 2 more matches
AddressErrors.country - Web APIs
an object based on address
errors includes a country property if during validation of the address the specified value of country was determined to be invalid.
... the value is a string describing the
error and should offer suggestions for how to correct it.
... syntax var country
error = address
errors.country; value if an
error occurred during validation of the address due to the country property having an invalid value, this property is set to a domstring providing a human-readable
error message explaining the validation
error.
...And 2 more matches
AddressErrors.dependentLocality - Web APIs
an object based on address
errors includes a dependentlocality property when the address's dependentlocality property couldn't be validated.
... the returned string explains the
error and should offer suggestions for how to correct it.
... syntax var locality
error = address
errors.dependentlocality; value if the value specified in the paymentaddress object's dependentlocality property could not be validated, this property contains a domstring offering a human-readable explanation of the validation
error and offers suggestions for correcting it.
...And 2 more matches
AddressErrors.languageCode - Web APIs
an object based on address
errors includes a languagecode property when the address's languagecode property couldn't be validated.
... the returned string explains the
error and should offer suggestions for how to correct it.
... syntax var language
error = address
errors.languagecode; value if the value specified in the paymentaddress object's languagecode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation
error and offers suggestions for correcting it.
...And 2 more matches
AddressErrors.organization - Web APIs
an object based on address
errors includes an organization property when the address's organization property couldn't be validated.
... the returned string explains the
error and should offer suggestions for how to correct it.
... syntax var organization
error = address
errors.organization; value if the value specified in the paymentaddress object's organization property could not be validated, this property contains a domstring offering a human-readable explanation of the validation
error and offers suggestions for correcting it.
...And 2 more matches
AddressErrors.phone - Web APIs
an object based on address
errors includes a phone property when the address's phone property couldn't be validated.
... the returned string explains the
error and should offer suggestions for how to correct it.
... syntax var phone
error = address
errors.phone; value if the value specified in the paymentaddress object's phone property could not be validated, this property contains a domstring offering a human-readable explanation of the validation
error and offers suggestions for correcting it.
...And 2 more matches
AddressErrors.postalCode - Web APIs
an object based on address
errors includes a postalcode property when the address's postalcode property couldn't be validated.
... the returned string explains the
error and should offer suggestions for how to correct it.
... syntax var postcode
error = address
errors.postcode; value if the value specified in the paymentaddress object's postalcode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation
error and offers suggestions for correcting it.
...And 2 more matches
AddressErrors.recipient - Web APIs
an object based on address
errors includes a recipient property when the address's recipient property couldn't be validated.
... the returned string explains the
error and should offer suggestions for how to correct it.
... syntax var recipient
error = address
errors.recipient; value if the value specified in the paymentaddress object's recipient property could not be validated, this property contains a domstring offering a human-readable explanation of the validation
error and offers suggestions for correcting it.
...And 2 more matches
AddressErrors.region - Web APIs
an object based on address
errors includes a region property when the address's region property couldn't be validated.
... the returned string explains the
error and should offer suggestions for how to correct it.
... syntax var region
error = address
errors.region; value if the value specified in the paymentaddress object's region property could not be validated, this property contains a domstring offering a human-readable explanation of the validation
error and offers suggestions for correcting it.
...And 2 more matches
AddressErrors.regionCode - Web APIs
an object based on address
errors includes a regioncode property when the address's regioncode property couldn't be validated.
... the returned string explains the
error and should offer suggestions for how to correct it.
... syntax var regioncode
error = address
errors.regioncode; value if the value specified in the paymentaddress object's regioncode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation
error and offers suggestions for correcting it.
...And 2 more matches
AddressErrors.sortingCode - Web APIs
an object based on address
errors includes a sortingcode property when the address's sortingcode property couldn't be validated.
... the returned string explains the
error and should offer suggestions for how to correct it.
... syntax var sortingcode
error = address
errors.sortingcode; value if the value specified in the paymentaddress object's sortingcode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation
error and offers suggestions for correcting it.
...And 2 more matches
Document.onfullscreenerror - Web APIs
the document.onfullscreen
error property is an event handler for the fullscreen
error event that is sent to the document when it fails to transition into full-screen mode after a prior call to element.requestfullscreen().
... syntax targetdocument.onfullscreen
error = fullscreen
errorhandler; value an event handler for the fullscreen
error event.
...since requestfullscreen() can only be called in response to user action, for security reasons, this will fail, causing the fullscreen
error to be sent to the document.
...And 2 more matches
Element: error event - Web APIs
the
error event is fired on an element object when a resource failed to load, or can't be used.
... for example, if a script has an execution
error or an image can't be found or is invalid.
... bubbles no cancelable no interface event or uievent event handler property on
error the event object is a uievent instance if it was generated from a user interface element, or an event instance otherwise.
...And 2 more matches
MediaRecorderErrorEvent - Web APIs
the mediarecorder
errorevent interface represents
errors returned by the mediastream recording api.
... it is an event object that encapsulates a reference to a domexception describing the
error that occurred.
...
error read only a domexception containing information about the
error that occurred.
...And 2 more matches
PaymentDetailsUpdate.shippingAddressErrors - Web APIs
the paymentdetailsupdate dictionary's shippingaddress
errors property, if present, contains an address
errors object whose contents provide
error messages for one or more of the values in the paymentaddress specified as paymentrequest.shippingaddress.
... syntax var address
errors = paymentdetailsupdate.shippingaddress
errors; value an address
errors object, which contains domstrings describing
errors in the properties of a paymentaddress.
... for each property in paymentaddress, a property by the same name is found in shippingaddress
errors if and only if a validation
error occurred for that property.
...And 2 more matches
RTCPeerConnectionIceErrorEvent.address - Web APIs
the rtcpeerconnectionice
errorevent property address is a string which indicates the local ip address being used to communicate with the stun or turn server during negotiations.
... the
error which occurred involved this address.
... syntax let address = rtcpeerconnectionice
errorevent.address; value a domstring which specifies the local ip address of the network connection to the ice server with which negotiations were occurring when the
error occurred.
...And 2 more matches
RTCPeerConnection: idpvalidationerror event - Web APIs
an idpvalidation
error event informs the target, a rtcpeerconnection object, that the identity provider (idp) encountered an
error when trying to validate an identity assertion.
... an event handler for this event can be added via the rtcpeerconnection.onidpvalidation
error property.
... bubbles no cancelable no interface rtcidentity
errorevent event handler property onidpvalidation
error important: this event is no longer used; it was removed from the specification long ago.
...And 2 more matches
SpeechRecognitionErrorEvent - Web APIs
the speechrecognition
errorevent interface of the web speech api represents
error messages from the recognition service.
... properties speechrecognition
errorevent also inherits properties from its parent interface, event.
... speechrecognition
errorevent.
error read only returns the type of
error raised.
...And 2 more matches
SpeechSynthesisErrorEvent - Web APIs
the speechsynthesis
errorevent interface of the web speech api contains information about any
errors that occur while processing speechsynthesisutterance objects in the speech service.
... properties speechsynthesis
errorevent extends the speechsynthesisevent interface, which inherits properties from its parent interface, event.
... speechsynthesis
errorevent.
error read only returns an
error code indicating what has gone wrong with a speech synthesis attempt.
...And 2 more matches
WritableStreamDefaultController.error() - Web APIs
the
error() method of the writablestreamdefaultcontroller interface causes any future interactions with the associated stream to
error.
... syntax writablestreamdefaultcontroller.
error(e); parameters e a domstring representing the
error you want future interactions to fail with.
... exceptions type
error the stream you are trying to
error is not a writablestream.
...And 2 more matches
500 Internal Server Error - HTTP
the hypertext transfer protocol (http) 500 internal server
error server
error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.
... this
error response is a generic "catch-all" response.
... usually, this indicates the server cannot find a better 5xx
error code to response.
...And 2 more matches
TypeError: can't define property "x": "obj" is not extensible - JavaScript
message type
error: cannot create property for a non-extensible object (edge) type
error: can't define property "x": "obj" is not extensible (firefox) type
error: cannot define property: "x", object is not extensible.
... (chrome)
error type type
error what went wrong?
... examples adding new properties to a non-extensible objects in strict mode, attempting to add new properties to a non-extensible object throws a type
error.
...And 2 more matches
TypeError: property "x" is non-configurable and can't be deleted - JavaScript
message type
error: calling delete on 'x' is not allowed in strict mode (edge) type
error: property "x" is non-configurable and can't be deleted.
... (firefox) type
error: cannot delete property 'x' of #<object> (chrome)
error type type
error in strict mode only.
... this
error happens only in strict mode code.
...And 2 more matches
SyntaxError: missing name after . operator - JavaScript
message syntax
error: missing name after .
... operator
error type syntax
error what went wrong?
... var obj = { foo: { bar: "baz", bar2: "baz2" } }; var i = 2; obj.[foo].[bar] // syntax
error: missing name after .
...And 2 more matches
SyntaxError: missing ) after condition - JavaScript
the javascript exception "missing ) after condition" occurs when there is an
error with how an if condition is written.
... message syntax
error: expected ')' (edge) syntax
error: missing ) after condition (firefox)
error type syntax
error what went wrong?
... there is an
error with how an if condition is written.
...And 2 more matches
SyntaxError: missing variable name - JavaScript
message syntax
error: missing variable name (firefox) syntax
error: unexpected token = (chrome)
error type syntax
error what went wrong?
...this is likely due to a syntax
error in your code.
...sorry :( var debugger = "whoop"; // syntax
error: missing variable name declaring multiple variables pay special attention to commas when declaring multiple variables.
...And 2 more matches
TypeError: "x" is not a function - JavaScript
message type
error: object doesn't support property or method {x} (edge) type
error: "x" is not a function
error type type
error what went wrong?
...prototype.map(), array.prototype.filter(), array.prototype.reduce(), array.prototype.reduceright(), array.prototype.find() when working with map and set objects: map.prototype.foreach() and set.prototype.foreach() examples a typo in the function name in this case, which happens way too often, there is a typo in the method name: let x = document.getelementbyid('foo'); // type
error: document.getelementbyid is not a function the correct function name is getelementbyid: let x = document.getelementbyid('foo'); function called on the wrong object for certain methods, you have to provide a (callback) function and it will work on specific objects only.
... let obj = {a: 13, b: 37, c: 42}; obj.map(function(num) { return num * 2; }); // type
error: obj.map is not a function use an array instead: let numbers = [1, 4, 9]; numbers.map(function(num) { return num * 2; }); // array [2, 8, 18] function shares a name with a pre-existing property sometimes when making a class, you may have a property and a function with the same name.
...And 2 more matches
TypeError: "x" is read-only - JavaScript
message type
error: assignment to read-only properties is not allowed in strict mode (edge) type
error: "x" is read-only (firefox) type
error: 0 is read-only (firefox) type
error: cannot assign to read only property 'x' of #<object> (chrome) type
error: cannot assign to read only property '0' of [object array] (chrome)
error type type
error what went wrong?
...(technically, it is a non-writable data property.) this
error happens only in strict mode code.
... 'use strict'; var obj = object.freeze({name: 'elsa', score: 157}); obj.score = 0; // type
error 'use strict'; object.defineproperty(this, 'lung_count', {value: 2, writable: false}); lung_count = 3; // type
error 'use strict'; var frozenarray = object.freeze([0, 1, 2]); frozenarray[0]++; // type
error there are also a few read-only properties built into javascript.
...And 2 more matches
Error.prototype.message - JavaScript
the message property is a human-readable description of the
error.
... description this property contains a brief description of the
error if one is available or has been set.
...the message property combined with the name property is used by the
error.prototype.tostring() method to create a string representation of the
error.
...And 2 more matches
Error.prototype.name - JavaScript
the name property represents a name for the type of
error.
... the initial value is "
error".
... description by default,
error instances are given the name "
error".
...And 2 more matches
InternalError() constructor - JavaScript
the internal
error() constructor creates an
error that indicates an
error that occurred internally in the javascript engine.
... for example: "internal
error: too much recursion".
... syntax new internal
error([message[, filename[, linenumber]]]) parameters message optional.
...And 2 more matches
ReferenceError() constructor - JavaScript
the reference
error object represents an
error when a non-existent variable is referenced.
... syntax new reference
error([message[, filename[, linenumber]]]) parameters message optional optional.
... human-readable description of the
error.
...And 2 more matches
TypeError() constructor - JavaScript
the type
error() constructor creates a new
error when an operation could not be performed, typically (but not exclusively) when a value is not of the expected type.
... syntax new type
error([message[, filename[, linenumber]]]) parameters message optional optional.
... human-readable description of the
error filename optional optional.
...And 2 more matches
URIError() constructor - JavaScript
the uri
error() constructor creates an
error when a global uri handling function was used in a wrong way.
... syntax new uri
error([message[, filename[, linenumber]]]) parameters message optional optional.
... human-readable description of the
error.
...And 2 more matches
WebAssembly.CompileError() constructor - JavaScript
the webassembly.compile
error() constructor creates a new webassembly compile
error object, which indicates an
error during webassembly decoding or validation.
... syntax new webassembly.compile
error(message, filename, linenumber) parameters message optional human-readable description of the
error.
... examples creating a new compile
error instance the following snippet creates a new compile
error instance, and logs its details to the console: try { throw new webassembly.compile
error('hello', 'somefile', 10); } catch (e) { console.log(e instanceof compile
error); // true console.log(e.message); // "hello" console.log(e.name); // "compile
error" console.log(e.filename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } spe...
...And 2 more matches
Syntax error - MDN Web Docs Glossary: Definitions of Web-related terms
syntax
errors are detected while compiling or parsing source code.
... for example, if you leave off a closing brace (}) when defining a javascript function, you trigger a syntax
error.
... browser development tools display javascript and css syntax
errors in the console.
... learn more general knowledge syntax
error on wikipedia syntax
error javascript object ...
nsIDOMGeoPositionErrorCallback
the nsidomgeoposition
errorcallback interface is used to represent an object that receives callback notifications when geolocation
errors occur.
... dom/interfaces/geolocation/nsidomgeoposition
errorcallback.idlscriptable please add a summary to this article.
... last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void handleevent(in nsidomgeoposition
error position); methods handleevent() called to handle a geolocation
error.
... void handleevent( in nsidomgeoposition position ); parameters position the
error that occurred, as an nsidomgeoposition
error object.
Element.onfullscreenerror - Web APIs
the element interface's onfullscreen
error property is an event handler for the fullscreen
error event which is sent to the element when an
error occurs while attempting to transition into or out of full-screen mode.
... syntax targetelement.onfullscreen
error = fullscreen
errorhandler; value an
error handler for the fullscreen
error event.
...since full-screen mode changes are only permitted in response to a user input, this causes an
error to occur, which triggers the delivery of the fullscreen
error event to the
error handler, let elem = document.queryselector("video")}} elem.onfullscreen
error = function ( event ) { displaywarning("unable to switch into full-screen mode."); }; //....
... elem.requestfullscreen(); specifications specification status comment fullscreen apithe definition of 'onfullscreen
error' in that specification.
FileReader.error - Web APIs
the filereader
error property returns the
error that occurred while reading the file.
... syntax var
error = instanceoffilereader.
error value a dom
error containing the relevant
error.
... in chrome 48+/firefox 58+ this property returns a domexception because dom
error has been removed from the dom standard.
... specifications specification status comment file apithe definition of 'filereader:
error' in that specification.
GeolocationPositionError.code - Web APIs
the geolocationposition
error.code read-only property is an unsigned short representing the
error code.
... syntax let typeerr = geolocationposition
errorinstance.code value an unsigned short representing the
error code.
... 2 position_unavailable the acquisition of the geolocation failed because one or several internal sources of position returned an internal
error.
... specifications specification status comment geolocation apithe definition of 'position
error.code' in that specification.
IDBDatabase: error event - Web APIs
the
error event is fired on idbdatabase when a request returns an
error and the event bubbles up to the connection object.
... bubbles yes cancelable no interface event event handler property on
error examples this example opens a database and tries to add a record, listening for the
error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique:...
... }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const db = dbopenrequest.result; db.addeventlistener('
error', () => { console.log(`
error adding new item: ${newitem.tasktitle}`); }); // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const objectstore = transaction.objectstore('todolist'); const objectstorerequest = objectstore.add(newitem); }; the same example, using the on
error property instead of addeventliste...
... { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const db = dbopenrequest.result; db.on
error = () => { console.log(`
error adding new item: ${newitem.tasktitle}`); }; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const objectstore = transaction.objectstore('todolist'); const objectstorerequest = objectstore.add(newitem); }; ...
IDBRequest: error event - Web APIs
the
error handler is executed when an
error caused a request to fail.
... bubbles yes cancelable no interface event event handler property on
error examples this example opens a database and tries to add a record, listening for the
error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.addeventlistener('upgradeneeded', event => { const db = event.target.result; db.on
error = () => { console.log('
error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', '...
...result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectstore.add(newitem); objectstorerequest.addeventlistener('
error', () => { console.log(`
error adding new item: ${newitem.tasktitle}`); }); }); the same example, using the on
error property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.on
error = () => { console.log('
error creating database'); }; /...
...= dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectstore.add(newitem); objectstorerequest.on
error = () => { console.log(`
error adding new item: ${newitem.tasktitle}`); }; }; ...
IDBTransaction: error event - Web APIs
the
error event is fired on idbtransaction when a request returns an
error and the event bubbles up to the transaction object.
... bubbles yes cancelable no interface event event handler property on
error examples this example opens a database and tries to add a record, listening for the
error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique:...
...ay', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); transaction.addeventlistener('
error', () => { console.log(`
error adding new item: ${newitem.tasktitle}`); }); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectstore.add(newitem); }; the same example, using the on
error property instead of addeventlistener(): // open the da...
...e.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); transaction.on
error = () => { console.log(`
error adding new item: ${newitem.tasktitle}`); }; const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectstore.add(newitem); }; ...
MessagePort: messageerror event - Web APIs
the message
error event is fired on a messageport object when it receives a message that can't be deserialized.
... bubbles no cancelable no interface messageevent event handler property onmessage
error examples suppose a script creates a messagechannel and sends one of the ports to a different browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addeventlistener('click', () => { myport.postmessage(messagecontrol.value); }) targetframe.postmessage('init', targetorigin, [channel.port2]); the target can receive the port and start l...
...istening for messages and message
errors on it using code like this: window.addeventlistener('message', (event) => { const myport = event.ports[0]; myport.addeventlistener('message', (event) => { received.textcontent = event.data; }); myport.addeventlistener('message
error', (event) => { console.
error(event.data); }); myport.start(); }); note that the listener must call messageport.start() before any messages will be delivered to this port.
... this is only needed when using the addeventlistener() method: if the receiver uses onmessage instead, start() is called implicitly: window.addeventlistener('message', (event) => { const myport = event.ports[0]; myport.onmessage = (event) => { received.textcontent = event.data; }; myport.onmessage
error = (event) => { console.
error(event.data); }; }); specifications specification status html living standard living standard ...
RTCPeerConnection: idpassertionerror event - Web APIs
an idpassertion
error event informs the target, a rtcpeerconnection object, that the identity provider (idp) encountered an
error when trying to generate an identity assertion.
... an event handler for this event can be added using the rtcpeerconnection.onidpassertion
error property.
... bubbles no cancelable no interface rtcidentity
errorevent event handler property onidpassertion
error warning: this event is no longer used; instead, you can detect an assertion
error by detecting when the promise returned by rtcpeerconnection.peeridentity is rejected.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'idpassertion
error' in that specification.
RTCPeerConnection: idpvalidationerror event - Web APIs
an idpvalidation
error event informs the target, a rtcpeerconnection object's onidpvalidation
error event handler, that the identity provider (idp) encountered an
error while validating an identity assertion.
... an event handler for this event can be added using the rtcpeerconnection.onidpvalidation
error property.
... bubbles no cancelable no interface rtcidentity
errorevent event handler property onidpvalidation
error warning: this event is no longer used; instead, you can detect a validation
error by detecting when the promise returned by rtcpeerconnection.peeridentity is rejected.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'idpvalidation
error' in that specification.
ReadableByteStreamController.error() - Web APIs
the
error() method of the readablebytestreamcontroller interface causes any future interactions with the associated stream to
error.
... syntax readablebytestreamcontroller.
error(e); parameters e the
error you want future interactions to fail with.
... exceptions type
error the source object is not a readablebytestreamcontroller, or the stream is not readable for some other reason.
... specifications specification status comment streamsthe definition of '
error()' in that specification.
Sensor.onerror - Web APIs
the on
error eventhandler is called when an
error occurs on one of the child interfaces of the sensor interface.
... syntax sensorinstance.on
error = function sensorinstance.addeventlistener('
error', function() { ...
... }) because sensor is a base class, on
error may only be used on one of its derived classes.
... specifications specification status comment generic sensor apithe definition of 'on
error' in that specification.
SensorErrorEvent - Web APIs
the sensor
errorevent interface of the sensor apis provides information about
errors thrown by a sensor or related interface.
... constructor sensor
errorevent.sensor
errorevent() creates a new sensor
errorevent object.
... properties sensor
errorevent.
error read only returns the domexception object passed in the event's contructor.
... specifications specification status comment generic sensor apithe definition of 'sensor
errorevent' in that specification.
SpeechRecognitionError.message - Web APIs
the message read-only property of the speechrecognition
error interface returns a message describing the
error in more detail.
... this speechrecognition
error interface was renamed to speechrecognition
errorevent in the web speech api specification.
... syntax var my
errormsg = event.message; value a domstring containing more details about the
error that was raised.
... examples var recognition = new speechrecognition(); recognition.on
error = function(event) { console.log('speech recognition
error detected: ' + event.
error); console.log('additional information: ' + event.message); } ...
WebSocket.onerror - Web APIs
the websocket interface's on
error event handler property is a function which gets called when an
error occurs on the websocket.
... you can also add an
error event handler using addeventlistener().
... syntax websocket.on
error = eventhandler; value a function or eventhandler which is executed whenever an
error event occurs on the websocket connection.
... example websocket.on
error = function(event) { console.
error("websocket
error observed:", event); }; specifications specification status comment html living standardthe definition of 'websocket: on
error' in that specification.
Window: error event - Web APIs
the
error event is fired on a window object when a resource failed to load or couldn't be used — for example if a script has an execution
error.
... bubbles no cancelable no interface event or uievent event handler property on
error the event object is a uievent instance if it was generated from a user interface element, or an event instance otherwise.
... examples live example html <div class="controls"> <button id="script-
error" type="button">generate script
error</button> <img class="bad-img" /> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="30"></textarea> </div> css body { display: grid; grid-template-areas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } button { height: 2rem; margin: .5rem; } img { width: 0; height: 0; } js const log = document.queryselector('.event-log-contents'); window.addeventlistener('
error', (event) => { log.textcontent = log...
....textcontent + `${event.type}: ${event.message}\n`; console.log(event) }); const script
error = document.queryselector('#script-
error'); script
error.addeventlistener('click', () => { const badcode = 'const s;'; eval(badcode); }); result specifications specification status ui events working draft ...
XDomainRequest.onerror - Web APIs
an event handler which is called when an xdomainrequest encounters an
error.
... note: there is no way to determine the cause of the
error from the xdomainrequest interface.
... syntax xdr.on
error = funcref; parameters funcref a function to call when an
error occurs.
... example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.on
error = function(){ //handle
error } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1¶m2=value2"); specification not part of any specification.
XMLHttpRequest: error event - Web APIs
the
error event is fired when the request encountered an
error.
... bubbles no cancelable no interface progressevent event handler property on
error examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr
error" type="button" name="xhr" value="click to start xhr (
error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbutton
error = document.
...queryselector('.xhr.
error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('
error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => ...
...{ runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbutton
error.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comment xmlhttprequest living standard ...
ReferenceError: deprecated caller or arguments usage - JavaScript
message type
error: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context (edge) warning: reference
error: deprecated caller usage (firefox) warning: reference
error: deprecated arguments usage (firefox) type
error: 'callee' and 'caller' cannot be accessed in strict mode.
... (safari)
error type a strict-mode-only warning that a reference
error occurred.
... 'use strict'; function myfunc() { if (myfunc.caller == null) { return 'the function was called from the top!'; } else { return 'this function\'s caller was ' + myfunc.caller; } } myfunc(); // warning: reference
error: deprecated caller usage // "the function was called from the top!" function.arguments function.arguments is deprecated (see the reference article for more information).
... 'use strict'; function f(n) { g(n - 1); } function g(n) { console.log('before: ' + g.arguments[0]); if (n > 0) { f(n); } console.log('after: ' + g.arguments[0]); } f(2); console.log('returned: ' + g.arguments); // warning: reference
error: deprecated arguments usage ...
TypeError: setting getter-only property "x" - JavaScript
message type
error: assignment to read-only properties is not allowed in strict mode (edge) type
error: setting getter-only property "x" (firefox) type
error: cannot set property "prop" of #<object> which has only a getter (chrome)
error type type
error in strict mode only.
...while this will be silently ignored in non-strict mode, it will throw a type
error in strict mode.
...it doesn't specify a setter, so a type
error will be thrown upon trying to set the temperature property to 30.
... "use strict"; function archiver() { var temperature = null; object.defineproperty(this, 'temperature', { get: function() { console.log('get!'); return temperature; } }); } var arc = new archiver(); arc.temperature; // 'get!' arc.temperature = 30; // type
error: setting getter-only property "temperature" to fix this
error, you will either need to remove line 16, where there is an attempt to set the temperature property, or you will need to implement a setter for it, for example like this: "use strict"; function archiver() { var temperature = null; var archive = []; object.defineproperty(this, 'temperature', { get: function() { console.log('get!'); return temperature; }, set...
SyntaxError: illegal character - JavaScript
message syntax
error: invalid character (edge) syntax
error: illegal character (firefox) syntax
error: invalid or unexpected token (chrome)
error type syntax
error what went wrong?
... “this looks like a string”; // syntax
error: illegal character // “ and ” are not " but look like this 42 – 13; // syntax
error: illegal character // – is not - but looks like this var foo = 'bar'; // syntax
error: illegal character // <37e> is not ; but looks like this this should work: "this is actually a str...
... var colors = ['#000', #333', '#666']; // syntax
error: illegal character add the missing quote for '#333'.
... var foo = 'bar'; // syntax
error: illegal character when inspecting this code in an editor like vim, you can see that there is actually a zero-width space (zwsp) (u+200b) character.
TypeError: invalid assignment to const "x" - JavaScript
message type
error: invalid assignment to const "x" (firefox) type
error: assignment to constant variable.
... (chrome) type
error: assignment to const (edge) type
error: redeclaration of const 'x' (ie)
error type type
error what went wrong?
... columns = 120; // type
error: invalid assignment to const `columns' fixing the
error there are multiple options to fix this
error.
...this means that you can't mutate the value stored in a variable: const obj = {foo: 'bar'}; obj = {foo: 'baz'}; // type
error: invalid assignment to const `obj' but you can mutate the properties in a variable: obj.foo = 'baz'; obj; // object { foo: "baz" } ...
SyntaxError: for-in loop head declarations may not have initializers - JavaScript
message syntax
error: for-in loop head declarations cannot have an initializer (edge) syntax
error: for-in loop head declarations may not have initializers (firefox) syntax
error: for-in loop variable declaration may not have an initializer.
... (chrome)
error type syntax
error in strict mode only.
...in strict mode, however, a syntax
error is thrown.
... examples this example throws a syntax
error: "use strict"; var obj = {a: 1, b: 2, c: 3 }; for (var i = 0 in obj) { console.log(obj[i]); } // syntax
error: for-in loop head declarations may not have initializers valid for-in loop you can remove the initializer (i = 0) in the head of the for-in loop.
SyntaxError: missing : after property id - JavaScript
message syntax
error: expected ':' (edge) syntax
error: missing : after property id (firefox)
error type syntax
error what went wrong?
... var obj = { propertykey = 'value' }; // syntax
error: missing : after property id correct would be to use a colon, or to use square brackets to assign a new property after the object has been created already.
... var obj = { propertykey: 'value' }; // or alternatively var obj = { }; obj['propertykey'] = 'value'; empty properties you can't create empty properties like this: var obj = { propertykey; }; // syntax
error: missing : after property id if you need to define a property without a value, you might use null as a value.
...otherwise the property name can't be computed: var obj = { 'b'+'ar': 'foo' }; // syntax
error: missing : after property id put the expression in brackets []: var obj = { ['b'+'ar']: 'foo' }; ...
SyntaxError: missing ) after argument list - JavaScript
the javascript exception "missing ) after argument list" occurs when there is an
error with how a function is called.
... message syntax
error: expected ')' (edge) syntax
error: missing ) after argument list (firefox)
error type syntax
error.
... there is an
error with how a function is called.
... console.log('pi: ' math.pi); // syntax
error: missing ) after argument list you can correct the log call by adding the "+" operator: console.log('pi: ' + math.pi); // "pi: 3.141592653589793" unterminated strings console.log('"java" + "script" = \"' + 'java' + 'script\"); // syntax
error: missing ) after argument list here javascript thinks that you meant to have ); inside the string and ignores it, and it ends up not knowing that you meant the ); to end the function console.log.
TypeError: More arguments needed - JavaScript
the javascript exception "more arguments needed" occurs when there is an
error with how a function is called.
... message type
error: argument is not an object and is not null (edge) type
error: object.create requires at least 1 argument, but only 0 were passed type
error: object.setprototypeof requires at least 2 arguments, but only 0 were passed type
error: object.defineproperties requires at least 1 argument, but only 0 were passed
error type type
error.
... there is an
error with how a function is called.
... examples required arguments not provided the object.create() method requires at least one argument and the object.setprototypeof() method requires at least two arguments: var obj = object.create(); // type
error: object.create requires at least 1 argument, but only 0 were passed var obj = object.setprototypeof({}); // type
error: object.setprototypeof requires at least 2 arguments, but only 1 were passed you can fix this by setting null as the prototype, for example: var obj = object.create(null); var obj = object.setprototypeof({}, null); ...
SyntaxError: "x" is a reserved identifier - JavaScript
message syntax
error: the use of a future reserved word for an identifier is invalid (edge) syntax
error: "x" is a reserved identifier (firefox) syntax
error: unexpected reserved word (chrome)
error type syntax
error what went wrong?
... var enum = { red: 0, green: 1, blue: 2 }; // syntax
error: enum is a reserved identifier in strict mode code, more identifiers are reserved.
... "use strict"; var package = ["potatoes", "rice", "fries"]; // syntax
error: package is a reserved identifier you'll need to rename these variables.
... "use strict"; class docarchiver {} // syntax
error: class is a reserved identifier // (throws in older browsers only, e.g.
InternalError: too much recursion - JavaScript
message
error: out of stack space (edge) internal
error: too much recursion (firefox) range
error: maximum call stack size exceeded (chrome)
error type internal
error.
...when there are too many function calls, or a function is missing a base case, javascript will throw this
error.
... function loop(x) { if (x >= 10) // "x >= 10" is the exit condition return; // do stuff loop(x + 1); // the recursive call } loop(0); setting this condition to an extremely high value, won't work: function loop(x) { if (x >= 1000000000000) return; // do stuff loop(x + 1); } loop(0); // internal
error: too much recursion this recursive function is missing a base case.
... function loop(x) { // the base case is missing loop(x + 1); // recursive call } loop(0); // internal
error: too much recursion class
error: too much recursion class person{ constructor(){} set name(name){ this.name = name; // recursive call } } const tony = new person(); tony.name = "tonisha"; // internal
error: too much recursion when a value is assigned to the property name (this.name = name;) javascript needs to set that property.
ReferenceError: assignment to undeclared variable "x" - JavaScript
message reference
error: assignment to undeclared variable "x" (firefox) reference
error: "x" is not defined (chrome) reference
error: variable undefined in strict mode (edge)
error type reference
error warning in strict mode only.
...there are some differences between declared and undeclared variables, which might lead to unexpected results and that's why javascript presents an
error in strict mode.
...
errors about undeclared variable assignments occur in strict mode code only.
... function foo() { 'use strict'; bar = true; } foo(); // reference
error: assignment to undeclared variable bar valid cases to make "bar" a declared variable, you can add the var keyword in front of it.
SyntaxError: function statement requires a name - JavaScript
message syntax
error: expected identifier (edge) syntax
error: function statement requires a name [firefox] syntax
error: unexpected token ( [chrome]
error type syntax
error what went wrong?
... examples statements vs expressions a function statement (or function declaration) requires a name, this won't work: function () { return 'hello world'; } // syntax
error: function statement requires a name you can use a function expression (assignment) instead: var greet = function() { return 'hello world'; }; or, you function is maybe intended to be an iife (immediately invoked function expression), which is a function that runs as soon as it is defined.
...this doesn't work: function greeter() { german: function () { return "moin"; } } // syntax
error: function statement requires a name this would work, for example: function greeter() { german: function g() { return "moin"; } } object methods if you intended to create a method of an object, you will need to create an object.
... promise.then( function() { console.log("success"); }); function() { console.log("
error"); } // syntax
error: function statement requires a name correct would be: promise.then( function() { console.log("success"); }, function() { console.log("
error"); } ); ...
SyntaxError: unterminated string literal - JavaScript
the javascript
error "unterminated string literal" occurs when there is an unterminated string somewhere.
... message syntax
error: unterminated string constant (edge) syntax
error: unterminated string literal (firefox)
error type syntax
error what went wrong?
...to fix this
error, check if: you have opening and closing quotes (single or double) for your string literal, you have escaped your string literal correctly, your string literal isn't split across multiple lines.
... examples multiple lines you can't split a string across multiple lines like this in javascript: var longstring = 'this is a very long string which needs to wrap across multiple lines because otherwise my code is unreadable.'; // syntax
error: unterminated string literal instead, use the + operator, a backslash, or template literals.
TypeError: 'x' is not iterable - JavaScript
message type
error: 'x' is not iterable (firefox, chrome) type
error: 'x' is not a function or its return value is not iterable (chrome)
error type type
error what went wrong?
... var obj = { 'france': 'paris', 'england': 'london' }; for (let p of obj) { // type
error: obj is not iterable // … } instead you have to use object.keys or object.entries, to iterate over the properties or entries of an object.
... function* generate(a, b) { yield a; yield b; } for (let x of generate) // type
error: generate is not iterable console.log(x); when they are not called, the function object corresponding to the generator is callable, but not iterable.
... } } array.from(myemptyiterable); // type
error: myemptyiterable is not iterable here is a correct implementation: const myemptyiterable = { [symbol.iterator]() { return [][symbol.iterator]() } } array.from(myemptyiterable); // [] ...
AggregateError() constructor - JavaScript
the aggregate
error() constructor creates an
error for several
errors that need to be wrapped in a single
error.
... syntax new aggregate
error(
errors[, message]) parameters
errors an iterable of
errors, may not actually be
error instances.
... messageoptional an optional human-readable description of the aggregate
error.
... examples creating an aggregate
error try { throw new aggregate
error([ new
error("some
error"), ], 'hello'); } catch (e) { console.log(e instanceof aggregate
error); // true console.log(e.message); // "hello" console.log(e.name); // "aggregate
error" console.log(e.
errors); // [
error: "some
error" ] } specifications specification promise.anythe definition of 'aggregate
error()' in that specification.
RangeError() constructor - JavaScript
the range
error() constructor creates an
error when a value is not in the set or range of allowed values.
... syntax new range
error([message[, filename[, linenumber]]]) parameters message optional human-readable description of the
error.
... filename optional the name of the file containing the code that caused the exception linenumber optional the line number of the code that caused the exception examples using range
error (for numeric values) function check(n) { if( !(n >= -500 && n <= 500) ) { throw new range
error("the argument must be between -500 and 500.") } } try { check(2000) } catch(
error) { if (
error instanceof range
error) { // handle the
error } } using range
error (for non-numeric values) function check(value) { if(["apple", "banana", "carrot"].includes(value) === false) { throw new range
error('the argument must be an "apple", "banana", or "carrot".') } } try { check("cabbage") } catch(
error) { if(
error instanceof range
error) { ...
... // handle the
error } } specifications specification ecmascript (ecma-262)the definition of 'native
error constructors' in that specification.
mozbrowsererror
the mozbrowser
error event is fired when an
error occurs while trying to load content within a browser <iframe>.
... detail the detail property returns an anonymous javascript object with the following properties: type a domstring representing the type of
error that occurred.
... unknownprotocolfound filenotfound dnsnotfound connectionfailure netinterrupt nettimeout cspblocked phishingblocked malwareblocked unwantedblocked offline malformeduri redirectloop unknownsockettype netreset notcached isprinting deniedportaccess proxyresolvefailure proxyconnectfailure contentencodingfailure remotexul unsafecontenttype corruptedcontent
error cert
error other example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowser
error", function( event ) { console.log("an
error occurred:" + event.detail); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow moz...
PR_GetError
returns the current thread's last set platform-independent
error code.
... syntax #include <pr
error.h> pr
errorcode pr_get
error(void) returns the value returned is a 32-bit number.
...nspr does use pr_set
error to set
error numbers defined in
error codes.
PR_GetErrorTextLength
gets the length of the
error text.
... syntax #include <pr
error.h> print32 pr_get
errortextlength(void) returns if a zero is returned, no
error text is currently set.
... otherwise, the value returned is sufficient to contain the
error text currently available.
NS_ERROR
summary macro throws a assertion (ns_assertion) with the text "
error: (
error text)", so writes this text to console (stderr) and to debug logs (nspr logging).
... this macro is meant for critical
errors; like assertions, ns_
errors should not be reachable.
... syntax ns_
error("
error text"); ...
AbstractWorker.onerror - Web APIs
the abstractworker.on
error property of the abstractworker interface represents an eventhandler, that is a function to be called when the
error event occurs and bubbles through the worker.
... syntax myworker.on
error = function() { ...
... }; example the following code snippet shows creation of a worker object using the worker() constructor and setting up of an on
error handler on the resulting object: var myworker = new worker('worker.js'); myworker.on
error = function() { console.log('there is an
error with your worker!'); } specifications specification status comment html living standardthe definition of 'abstractworker.on
error' in that specification.
AudioWorkletNode.onprocessorerror - Web APIs
the onprocessor
error property of the audioworkletnode interface defines an event handler function to be called when the processor
error event fires.
... syntax audioworkletnode.onprocessor
error = function() { ...
... }; examples // fill in example snippet specifications specification status comment web audio apithe definition of 'onprocessor
error' in that specification.
BroadcastChannel.onmessageerror - Web APIs
the onmessage
error event handler of the broadcastchannel interface is an eventlistener, called whenever an messageevent of type message
error is fired on the broadcastchannel instance — that is, when it receives a message that cannot be deserialized.
... syntax bc.onmessage
error = function() { ...
... }; specifications specification status comment html living standardthe definition of 'onmessage
error' in that specification.
Console.error() - Web APIs
outputs an
error message to the web console.
... syntax console.
error(obj1 [, obj2, ..., objn]); console.
error(msg [, subst1, ..., substn]); console.exception(obj1 [, obj2, ..., objn]); console.exception(msg [, subst1, ..., substn]); note: console.exception() is an alias for console.
error(); they are functionally identical.
... specifications specification status comment console apithe definition of 'console.
error()' in that specification.
DedicatedWorkerGlobalScope.onmessageerror - Web APIs
the onmessage
error event handler of the dedicatedworkerglobalscope interface is an eventlistener, called whenever an messageevent of type message
error is fired on the worker—that is, when it receives a message that cannot be deserialized.
... syntax onmessage
error = function() { ...
... }; specifications specification status comment html living standardthe definition of 'onmessage
error' in that specification.
Document: fullscreenerror event - Web APIs
the fullscreen
error event is fired when the browser cannot switch to full-screen mode.
... bubbles yes cancelable no interface event event handler property onfullscreen
error as with the fullscreenchange event, two fullscreen
error events are fired; the first is sent to the element which failed to change modes, and the second is sent to the document which owns that element.
... examples const requestor = document.queryselector('div'); document.addeventlistener('fullscreen
error', (event) => { console.
error('an
error occurred changing into fullscreen'); console.log(event); }); requestor.requestfullscreen(); specifications specification status fullscreen api living standard ...
Element: fullscreenerror event - Web APIs
the fullscreen
error event is fired when the browser cannot switch to full-screen mode.
... bubbles yes cancelable no interface event event handler property onfullscreen
error as with the fullscreenchange event, two fullscreen
error events are fired; the first is sent to the element which failed to change modes, and the second is sent to the document which contains that element.
... examples const requestor = document.queryselector('div'); requestor.addeventlistener('fullscreen
error', (event) => { console.
error('an
error occurred changing into fullscreen'); console.log(event); }); requestor.requestfullscreen(); specifications specification status fullscreen api living standard ...
EventSource.onerror - Web APIs
the on
error property of the eventsource interface is an eventhandler called when an
error occurs and the
error event is dispatched on an eventsource object.
... syntax eventsource.on
error = function examples evtsource.on
error = function() { console.log("eventsource failed."); }; note: you can find a full example on github — see simple sse demo using php.
... specifications specification status comment html living standardthe definition of 'on
error' in that specification.
GeolocationPositionError.message - Web APIs
the geolocationposition
error.message read-only property returns a human-readable domstring describing the details of the
error.
... syntax let msg = geolocationposition
errorinstance.message value a human-readable domstring describing the details of the
error.
... specifications specification status comment geolocation apithe definition of 'geolocationposition
error.message' in that specification.
MediaRecorder: error event - Web APIs
the mediarecorder interface's
error event is fired when an
error occurs: for example because recording wasn't allowed or was attempted using an unsupported codec.
... bubbles no cancelable no interface mediarecorder
errorevent event handler property on
error for details of the all the possible
errors see the documentation for the event handler property: on
error.
... examples using addeventlistener to listen for
error events: async function record() { const stream = await navigator.mediadevices.getusermedia({audio: true}); const recorder = new mediarecorder(stream); recorder.addeventlistener('
error', (event) => { console.
error(`
error recording stream: ${event.
error.name}`) }); recorder.start(); } record(); the same, but using the on
error event handler property: async function record() { const stream = await navigator.mediadevices.getusermedia({audio: true}); const recorder = new mediarecorder(stream); recorder.on
error = (event) => { console.
error(`
error recording stream: ${event.
error.name}`) }; recorder.start(); } record(); specifications specification status mediastream...
MessagePort.onmessageerror - Web APIs
the onmessage
error event handler of the messageport interface is an eventlistener, called whenever an messageevent of type message
error is fired on the port—that is, when it receives a message that cannot be deserialized.
... syntax port.onmessage
error = function() { ...
... }; specifications specification status comment html living standardthe definition of 'onmessage
error' in that specification.
Notification.onerror - Web APIs
the on
error property of the notification interface specifies an event listener to receive
error events.
... these events occur when something goes wrong with a notification (in many cases an
error preventing the notification from being displayed.) syntax notification.on
error = function() { ...
... }; specifications specification status comment notifications apithe definition of 'on
error' in that specification.
PaymentDetailsUpdate.error - Web APIs
the paymentdetailsupdate dictionary's
error property is a human-readable domstring which provides an
error message to be displayed if the specified information doesn't offer any valid shipping options.
... syntax
errorstring = paymentdetailsupdate.
error; paymentdetailsupdate.
error =
errorstring; value a domstring specifying the string to display to the user if the information specified in the paymentdetailsupdate doesn't provide any valid shipping options.
... specifications specification status comment payment request apithe definition of 'paymentdetailsupdate.
error' in that specification.
RTCIdentityErrorEvent.idp - Web APIs
the read-only property rtcidentity
errorevent.idp returns the domstring describing the domain name of the identity provider (idp) generating the
error response event.
... firefox implements the interface of this property under the following name: rtcpeerconnectionidentity
errorevent.
... syntax var idp = event.idp; event.idp = "developer.mozilla.org"; example pc.onidpassertion
error = function( ev ) { alert("the idp named '" + ev.idp + "' encountered an
error " + "while generating an assertion."); } ...
RTCIdentityErrorEvent.loginUrl - Web APIs
the read-only property rtcidentity
errorevent.loginurl is a domstring giving the url where the user can complete the authentication.
... firefox implements the interface of this property under the following name: rtcpeerconnectionidentity
errorevent.
... syntax var loginurl = event.loginurl; event.loginurl = "https://developer.mozilla.org/fakeurl"; example pc.onidpassertion
error = function( ev ) { alert("the idp requested an authentication" + " to be performed at th3 url '" + ev.url + "'."); } ...
RTCIdentityErrorEvent.protocol - Web APIs
the read-only property rtcidentity
errorevent.protocol is a domstring describing the idp protocol in use.
... firefox implements the interface of this property under the following name: rtcpeerconnectionidentity
errorevent.
... syntax var protocol = event.protocol; event.protocol = "idp.html"; example pc.onidpassertion
error = function( ev ) { alert("the idp uses the following protocol '" + ev.protocol + "."); } ...
SVGElement: error event - Web APIs
the
error event is fired when an svg element does not load properly or when an
error occurs during script execution.
... this basically implements the standard
error dom event.
... bubbles yes cancelable no interface svgevent event handler property on
error examples svgelem.addeventlistener('
error', () => { console.log('svg not loaded properly.'); }) specifications specification status comment scalable vector graphics (svg) 2the definition of '
error' in that specification.
ServiceWorkerContainer.onerror - Web APIs
the on
error property of the serviceworkercontainer interface is an event handler fired whenever an
error event occurs in the associated service workers.
... syntax serviceworkercontainer.on
error = function(
errorevent) { ...
... } example navigator.serviceworker.on
error = function(
errorevent) { console.log(`received
error message: ${
errorevent.message}`); } ...
SpeechRecognitionErrorEvent.message - Web APIs
the message read-only property of the speechrecognition
errorevent interface returns a message describing the
error in more detail.
... syntax var my
errormsg = event.message; value a domstring containing more details about the
error that was raised.
... examples var recognition = new speechrecognition(); recognition.on
error = function(event) { console.log('speech recognition
error detected: ' + event.
error); console.log('additional information: ' + event.message); } specifications specification status comment web speech apithe definition of 'message' in that specification.
WindowEventHandlers.onmessageerror - Web APIs
the onmessage
error event handler of the windoweventhandlers interface is an eventlistener, called whenever an messageevent of type message
error is fired on a window—that is, when it receives a message that cannot be deserialized.
... syntax window.onmessage
error = function() { ...
... }; specifications specification status comment html living standardthe definition of 'onmessage
error' in that specification.
Worker: messageerror event - Web APIs
the message
error event is fired on a worker object when it receives a message that can't be deserialized.
... bubbles no cancelable no interface messageevent event handler property onmessage
error examples create a worker, and listen for message and message
error events using addeventlistener(): // inside main.js const worker = new worker("static/scripts/worker.js"); worker.addeventlistener("message", (event) => { console.
error(`received message from worker: ${event}`); }); worker.addeventlistener("message
error", (event) => { console.
error(`
error receiving message from worker: ${event}`); }); the same, but using the onmessage
error event handler property: // inside main.js const worker = new worker("static/scripts/worker.js"); worker.onmessage = (event) => { console.
error(`received message from worker: ${event}`); }; worker.onm...
...essage
error = (event) => { console.
error(`
error receiving message from worker: ${event}`); }; specifications specification status html living standard living standard ...
Worker.onmessageerror - Web APIs
the onmessage
error event handler of the worker interface is an eventlistener, called whenever an messageevent of type message
error is fired on the worker instance — that is, when it receives a message that cannot be deserialized.
... syntax worker.onmessage
error = function() { ...
... }; specifications specification status comment html living standardthe definition of 'onmessage
error' in that specification.
WorkerGlobalScope.onerror - Web APIs
the on
error property of the workerglobalscope interface represents an eventhandler to be called when the
error event occurs and bubbles through the worker.
... syntax self.on
error = function() { ...
... }; example the following code snippet shows an on
error handler set inside a worker: self.on
error = function() { console.log('there is an
error inside your worker!'); } specifications specification status comment html living standardthe definition of 'workerglobalscope.on
error' in that specification.
XMLHttpRequestEventTarget.onerror - Web APIs
the xmlhttprequesteventtarget.on
error is the function called when an xmlhttprequest transaction fails due to an
error.
... syntax xmlhttprequest.on
error = callback; values callback is the function to be executed when the request fails.
... example var xmlhttp = new xmlhttprequest(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.on
error = function () { console.log("** an
error occurred during the transaction"); }; xmlhttp.send(); specifications specification status comment xmlhttprequest living standard whatwg living standard ...
::grammar-error - CSS: Cascading Style Sheets
the ::grammar-
error css pseudo-element represents a text segment which the user agent has flagged as grammatically incorrect.
... allowable properties only a small subset of css properties can be used in a rule with ::grammar-
error in its selector: color background-color cursor caret-color outline and its longhands text-decoration and its associated properties text-emphasis-color text-shadow syntax ::grammar-
error examples simple document grammar check in this example, eventual supporting browsers should highlight any flagged grammatical
errors with the styles shown.
... html <p>my friends is coming to the party tonight.</p> css ::grammar-
error { text-decoration: underline red; color: red; } result specifications specification status comment css pseudo-elements level 4the definition of '::grammar-
error' in that specification.
::spelling-error - CSS: Cascading Style Sheets
the ::spelling-
error css pseudo-element represents a text segment which the user agent has flagged as incorrectly spelled.
... allowable properties only a small subset of css properties can be used in a rule with ::spelling-
error in its selector: color background-color cursor caret-color outline and its longhands text-decoration and its associated properties text-emphasis-color text-shadow syntax ::spelling-
error examples simple document spell check in this example, eventual supporting browsers should highlight any flagged spelling
errors with the styles shown.
... html <p contenteditable spellcheck="true">my friends are coegdfgfddffbgning to the party tonight.</p> css ::spelling-
error { text-decoration: wavy red; } result specifications specification status comment css pseudo-elements level 4the definition of '::spelling-
error' in that specification.
SyntaxError: invalid regular expression flag "x" - JavaScript
message syntax
error: syntax
error in regular expression (edge) syntax
error: invalid regular expression flag "x" (firefox) syntax
error: invalid regular expression flags (chrome)
error type syntax
error what went wrong?
... /foo/bar; // syntax
error: invalid regular expression flag "b" did you intend to create a regular expression?
... let obj = { url: /docs/web }; // syntax
error: invalid regular expression flag "w" or did you mean to create a string instead?
TypeError: can't assign to property "x" on "y": not an object - JavaScript
message type
error: can't assign to property "x" on {y}: not an object (firefox) type
error: cannot create property 'x' on {y} (chrome)
error type type
error.
... in strict_mode, a type
error is raised when attempting to create a property on primitive value such as a symbol, a string, a number or a boolean.
...foo.bar = {}; // type
error: can't assign to property "bar" on "my string": not an object fixing the issue either fix the code to prevent the primitive from being used in such places, or fix the issue is to create the object equivalent object.
SyntaxError: "0"-prefixed octal literals and octal escape seq. are deprecated - JavaScript
message syntax
error: octal numeric literals and escape characters not allowed in strict mode (edge) syntax
error: "0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead
error type syntax
error in strict mode only.
... octal literals and octal escape sequences are deprecated and will throw a syntax
error in strict mode.
... examples "0"-prefixed octal literals "use strict"; 03; // syntax
error: "0"-prefixed octal literals and octal escape sequences // are deprecated octal escape sequences "use strict"; "\251"; // syntax
error: "0"-prefixed octal literals and octal escape sequences // are deprecated valid octal numbers use a leading zero followed by the letter "o" or "o": 0o3; for octal escape sequences, you can use hexadecimal escape sequences instead: '\xa9'; ...
SyntaxError: a declaration in the head of a for-of loop can't have an initializer - JavaScript
message syntax
error: for-of loop head declarations cannot have an initializer (edge) syntax
error: a declaration in the head of a for-of loop can't have an initializer (firefox) syntax
error: for-of loop variable declaration may not have an initializer.
... (chrome)
error type syntax
error what went wrong?
... examples invalid for-of loop let iterable = [10, 20, 30]; for (let value = 50 of iterable) { console.log(value); } // syntax
error: a declaration in the head of a for-of loop can't // have an initializer valid for-of loop you need to remove the initializer (value = 50) in the head of the for-of loop.
URIError: malformed URI sequence - JavaScript
message uri
error: the uri to be encoded contains invalid character (edge) uri
error: malformed uri sequence (firefox) uri
error: uri malformed (chrome)
error type uri
error what went wrong?
...an uri
error will be thrown if there is an attempt to encode a surrogate which is not part of a high-low pair, for example: encodeuri('\ud800'); // "uri
error: malformed uri sequence" encodeuri('\udfff'); // "uri
error: malformed uri sequence" a high-low pair is ok.
...if there isn't such a character, an
error will be thrown: decodeuricomponent('%e0%a4%a'); // "uri
error: malformed uri sequence" with proper input, this should usually look like something like this: decodeuricomponent('javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "javascript_шеллы" ...
SyntaxError: Malformed formal parameter - JavaScript
message syntax
error: expected {x} (edge) syntax
error: malformed formal parameter (firefox)
error type syntax
error what went wrong?
... admittedly the wording in the
error message is slightly strange.
... examples invalid cases var f = function('x y', 'return x + y;'); // syntax
error (missing a comma) var f = function('x,', 'return x;'); // syntax
error (extraneous comma) var f = function(37, "alert('ok')"); // syntax
error (numbers can't be argument names) valid cases var f = function('x, y', 'return x + y;'); // correctly punctuated var f = function('x', 'return x;'); // if you can, avoid using function - this is much faster var f = function(x) { return x; }; ...
SyntaxError: missing ] after element list - JavaScript
the javascript exception "missing ] after element list" occurs when there is an
error with the array initializer syntax somewhere.
... message syntax
error: missing ] after element list
error type syntax
error.
... there is an
error with the array initializer syntax somewhere.
TypeError: "x" is not a non-null object - JavaScript
message type
error: invalid descriptor for property {x} (edge) type
error: "x" is not a non-null object (firefox) type
error: property description must be an object: "x" (chrome) type
error: invalid value used in weak set (chrome)
error type type
error what went wrong?
...providing no object (like just a number), will throw an
error: object.defineproperty({}, 'key', 1); // type
error: 1 is not a non-null object object.defineproperty({}, 'key', null); // type
error: null is not a non-null object a valid property descriptor object might look like this: object.defineproperty({}, 'key', { value: 'foo', writable: false }); weakmap and weakset objects require object keys weakmap and weakset objects store object keys.
... var ws = new weakset(); ws.add('foo'); // type
error: "foo" is not a non-null object use objects instead: ws.add({foo: 'bar'}); ws.add(window); ...
TypeError: can't delete non-configurable array element - JavaScript
message type
error: can't delete non-configurable array element (firefox) type
error: cannot delete property '2' of [object array] (chrome)
error type type
error what went wrong?
... var arr = []; object.defineproperty(arr, 0, {value: 0}); object.defineproperty(arr, 1, {value: "1"}); arr.length = 1; // type
error: can't delete non-configurable array element you will need to set the elements as configurable, if you intend to shorten the array.
... var arr = [1,2,3]; object.seal(arr); arr.length = 1; // type
error: can't delete non-configurable array element you either need to remove the object.seal() call, or make a copy of it.
RangeError: argument is not a valid code point - JavaScript
message range
error: {0} is not a valid code point (firefox) range
error: invalid code point {0} (chromium)
error type range
error what went wrong?
... string.fromcodepoint() throws this
error when passed nan values, negative integers (-1), non-integers (5.4), or values larger than 0x10ffff (1114111).
... examples invalid cases string.fromcodepoint('_'); // range
error string.fromcodepoint(infinity); // range
error string.fromcodepoint(-1); // range
error string.fromcodepoint(3.14); // range
error string.fromcodepoint(3e-2); // range
error string.fromcodepoint(nan); // range
error valid cases string.fromcodepoint(42); // "*" string.fromcodepoint(65, 90); // "az" string.fromcodepoint(0x404); // "\u0404" string.fromcodepoint(0x2f804); // "\ud87e\udc04" string.fromcodepoint(194564); // "\ud87e\udc04" string.fromcodepoint(0x1d306, 0x61, 0x1d307) // "\ud834\udf06a\ud834\udf07" ...
TypeError: "x" is not a constructor - JavaScript
message type
error: object doesn't support this action (edge) type
error: "x" is not a constructor type
error: math is not a constructor type
error: json is not a constructor type
error: symbol is not a constructor type
error: reflect is not a constructor type
error: intl is not a constructor type
error: atomics is not a constructor
error type type
error what went wrong?
... examples invalid cases var car = 1; new car(); // type
error: car is not a constructor new math(); // type
error: math is not a constructor new symbol(); // type
error: symbol is not a constructor function* f() {}; var obj = new f; // type
error: f is not a constructor a car constructor suppose you want to create an object type for cars.
... this is not legal (the promise constructor is not being called correctly) and will throw a type
error: this is not a constructor exception: return new promise.resolve(true); instead, use the promise.resolve() or promise.reject() static methods: // this is legal, but unnecessarily long: return new promise((resolve, reject) => { resolve(true); }) // instead, return the static method: return promise.resolve(true); return promise.reject(false); ...
ReferenceError: "x" is not defined - JavaScript
message reference
error: "x" is not defined
error type reference
error.
... examples variable not declared foo.substring(1); // reference
error: foo is not defined the "foo" variable isn't defined anywhere.
...variables defined inside a function cannot be accessed from anywhere outside the function, because the variable is defined only in the scope of the function function numbers() { var num1 = 2, num2 = 3; return num1 + num2; } console.log(num1); // reference
error num1 is not defined.
SyntaxError: "use strict" not allowed in function with non-simple parameters - JavaScript
message edge: cannot apply strict mode on functions with non-simple parameter list firefox: syntax
error: "use strict" not allowed in function with default parameter syntax
error: "use strict" not allowed in function with rest parameter syntax
error: "use strict" not allowed in function with destructuring parameter chrome: syntax
error: illegal 'use strict' directive in function with non-simple parameter list
error type syntax
error.
... examples function statement in this case, the function sum has default parameters a=1 and b=2: function sum(a = 1, b = 2) { // syntax
error: "use strict" not allowed in function with default parameter 'use strict'; return a + b; } if the function should be in strict mode, and the entire script or enclosing function is also okay to be in strict mode, you can move the "use strict" directive outside of the function: 'use strict'; function sum(a = 1, b = 2) { return a + b; } function expression a function expression can use y...
...et another workaround: var sum = function sum([a, b]) { // syntax
error: "use strict" not allowed in function with destructuring parameter 'use strict'; return a + b; }; this can be converted to the following expression: var sum = (function() { 'use strict'; return function sum([a, b]) { return a + b; }; })(); arrow function if an arrow function needs to access the this variable, you can use the arrow function as the enclosing function: var callback = (...args) => { // syntax
error: "use strict" not allowed in function with rest parameter 'use strict'; return this.run(args); }; this can be converted to the following expression: var callback = (() => { 'use strict'; return (...args) => { return this.run(args); }; })(); ...
ReferenceError: reference to undefined property "x" - JavaScript
message reference
error: reference to undefined property "x" (firefox)
error type (firefox only) reference
error warning which is reported only if javascript.options.strict preference is set to true.
... examples invalid cases in this case, the property bar is an undefined property, so a reference
error will occur.
... var foo = {}; foo.bar; // reference
error: reference to undefined property "bar" valid cases to avoid the
error, you need to either add a definition for bar to the object or check for the existence of the bar property before trying to access it; one way to do that is to use the object.prototype.hasownproperty() method), like this: var foo = {}; // define the bar property foo.bar = 'moon'; console.log(foo.bar); // "moon" // test to be sure bar exists before accessing it if (foo.hasownproperty('bar')) { console.log(foo.bar); } ...
SyntaxError: Unexpected token - JavaScript
message syntax
error: expected expression, got "x" syntax
error: expected property name, got "x" syntax
error: expected target, got "x" syntax
error: expected rest argument name, got "x" syntax
error: expected closing parenthesis, got "x" syntax
error: expected '=>' after argument list, got "x"
error type syntax
error what went wrong?
... for (let i = 0; i < 5,; ++i) { console.log(i); } // syntax
error: expected expression, got ')' correct would be omitting the comma or adding another expression: for (let i = 0; i < 5; ++i) { console.log(i); } not enough brackets sometimes, you leave out brackets around if statements: function round(n, upperbound, lowerbound){ if(n > upperbound) || (n < lowerbound){ throw 'number ' + string(n) + ' is more than ' + string(upperbound) + ' or less than ' + string(lowerbound); }else if(n < ((upperbound + lowerbound)/2)){ return lowerbound; }else{ return upperbou...
...nd; } } // syntax
error: expected expression, got '||' the brackets may look correct at first, but note how the || is outside the brackets.
TypeError: cannot use 'in' operator to search for 'x' in 'y' - JavaScript
message type
error: invalid operand to 'in' (edge) type
error: right-hand side of 'in' should be an object, got 'x' (firefox) type
error: cannot use 'in' operator to search for 'x' in 'y' (firefox, chrome)
error type type
error what went wrong?
... "hello" in "hello world"; // type
error: cannot use 'in' operator to search for 'hello' in 'hello world' instead you will need to use string.prototype.indexof(), for example.
... var foo = null; "bar" in foo; // type
error: cannot use 'in' operator to search for 'bar' in 'foo' (chrome) // type
error: right-hand side of 'in' should be an object, got null (firefox) the in operator always expects an object.
Error.prototype.fileName - JavaScript
the filename property contains the path to the file that raised this
error.
... description this non-standard property contains the path to the file that raised this
error.
... examples using filename var e = new
error('could not parse input'); throw e; // e.filename could look like "file:///c:/example.html" specifications not part of any standard.
SyntaxError() constructor - JavaScript
the syntax
error constructor creates a new
error object that represents an
error when trying to interpret syntactically invalid code.
... syntax new syntax
error([message[, filename[, linenumber]]]) parameters message optional human-readable description of the
error filename optional the name of the file containing the code that caused the exception linenumber optional the line number of the code that caused the exception examples catching a syntax
error try { eval('hoo bar'); } catch (e) { console.
error(e instanceof syntax
error); console.
error(e.message); console.
error(e.name); console.
error(e.filename); console.
error(e.linenumber); console.
error(e.columnnumber); console.
error(e.stack); } creating a syntax
error try { throw new syntax
error('hello', 'somefile.js', 10); } catch (e) { console.
error(e instanceof syntax
error); // true console.
error(e.message); // hello console.
...
error(e.name); // syntax
error console.
error(e.filename); // somefile.js console.
error(e.linenumber); // 10 console.
error(e.columnnumber); // 0 console.
error(e.stack); // @debugger eval code:3:9 } specifications specification ecmascript (ecma-262)the definition of 'native
error constructor' in that specification.
error - Archive of obsolete content
the
error event is fired when an
error occurred while downloading the cache manifest or updating the content of the application.
... related events checking noupdate downloading progress cached updateready obsolete
error ...
PR_GetErrorText
copies the current thread's current
error text without altering the text as stored in the thread's context.
... syntax #include <pr
error.h> print32 pr_get
errortext(char *text); parameters the function has one parameter: text on output, the array pointed to contains the thread's current
error text.
nsIDOMFileError
the nsidomfile
error interface describes
errors that occur while using the dom file api.
... it implements the dom file
error object; for details, please read that article.
BroadcastChannel: messageerror event - Web APIs
the message
error event is fired on a broadcastchannel object when a message arrives on the channel that can't be deserialized.
... bubbles no cancelable no interface messageevent event handler property onmessage
error examples this code uses addeventlistener to listen for messages and
errors: const channel = new broadcastchannel('example-channel'); channel.addeventlistener('message', (event) => { received.textcontent = event.data; }); channel.addeventlistener('message
error', (event) => { console.
error(event); }); the same, but using the onmessage and onmessage
error event handler properties: const channel = new broadcastchannel('example-channel'); channel.onmessage = (event) => { received.textcontent = event.data; }; channel.onmessage
error = (event) => { console.log(event); }; specifications specification status html living stand...
DedicatedWorkerGlobalScope: messageerror event - Web APIs
the message
error event is fired on a dedicatedworkerglobalscope object when it receives a message that can't be deserialized.
... bubbles no cancelable no interface messageevent event handler property onmessage
error examples listen for message
error using addeventlistener(): // inside worker.js self.addeventlistener('message
error', (event) => { self.postmessage('
error receiving message'); console.
error(event); }); the same, but using the onmessage
error event handler property: // inside worker.js self.onmessage
error = (event) => { self.postmessage('
error receiving message'); console.
error(event); }; specifications specification status html living standard living standard ...
Document: pointerlockerror event - Web APIs
the pointerlock
error event is fired when locking the pointer failed (for technical reasons or because the permission was denied).
... bubbles yes cancelable no interface event event handler property onpointerlock
error examples using addeventlistener(): const para = document.queryselector('p'); document.addeventlistener('pointerlock
error', (event) => { console.log('
error locking pointer'); }); using the onpointerlock
error event handler property: document.onpointerlock
error = (event) => { console.log('
error locking pointer'); }; specifications specification status pointer lock candidate recommendation ...
EventSource: error event - Web APIs
the
error event of the eventsource api is fired when a connection with an event source fails to be opened.
... bubbles no cancelable no interface event or
errorevent event handler property eventsource.on
error examples var evtsource = new eventsource('sse.php'); // addeventlistener version evtsource.addeventlistener('
error', (e) => { console.log("an
error occurred while attempting to connect."); }); // on
error version evtsource.on
error = (e) => { console.log("an
error occurred while attempting to connect."); }; specifications specification status html living standardthe definition of '
error event' in that specification.
FileReader: error event - Web APIs
the
error event is fired when the read failed due to an
error (for example, because the file was not found or not readable).
... bubbles no cancelable no interface progressevent event handler property filereader.on
error examples const fileinput = document.queryselector('input[type="file"]'); const reader = new filereader(); function handleselected(e) { const selectedfile = fileinput.files[0]; if (selectedfile) { reader.addeventlistener('
error', () => { console.
error(`
error occurred reading file: ${selectedfile.name}`); }); reader.addeventlistener('load', () => { console.
error(`file: ${selectedfile.name} read successfully`); }); reader.readasdataurl(selectedfile); } } fileinput.addeventlistener('change', handleselected); specifications specification status f...
HTMLCanvasElement: webglcontextcreationerror event - Web APIs
the webglcontextcreation
error event of the webgl api is fired if the user agent is unable to create a webglrenderingcontext context.
... bubbles yes cancelable yes interface webglcontextevent event handler property none example var canvas = document.getelementbyid('canvas'); canvas.addeventlistener('webglcontextcreation
error', function(e) { console.log(e.statusmessage || 'unknown
error'); }, false); var gl = canvas.getcontext('webgl'); // logs statusmessage or "unknown
error" if unable to create webgl context specifications specification status comment webgl 1.0the definition of 'webglcontextcreation
error' in that specification.
HTMLMediaElement: error event - Web APIs
the
error event is fired when the resource could not be loaded due to an
error (for example, a network connectivity problem).
... bubbles no cancelable no interface event event handler property on
error examples const video = document.queryselector('video'); const videosrc = 'https://path/to/video.webm'; video.addeventlistener('
error', () => { console.
error(`
error loading: ${videosrc}`); }); video.setattribute('src', videosrc); specifications specification status html living standard living standard html5 recommendation ...
FileHandle.onerror - Web APIs
summary specifies an event listener to receive
error events.
... syntax instanceoffilehandle.on
error = funcref; where funcref is a function to be called when the
error event occurs.
LockedFile.onerror - Web APIs
summary specifies an event listener to receive
error events.
... syntax instanceoflockedfile.on
error = funcref; where funcref is a function to be called when the
error event occurs.
NDEFReader.onerror - Web APIs
the on
error property of ndefreader interface of the web nfc api is called whenever an
error occurs during reading of nfc tags, e.g.
... specifications specification status comment web nfc, ndefreader.on
error draft initial definition.
OverconstrainedError.constraint - Web APIs
the constraint read-only property of the overconstrained
error interface returns the constraint that was supplied in the constructor, meaning the contraint that was not satisfied.
... syntax var constraint = overconstrained
error.constraint; value a string specifications specification status comment media capture and streamsthe definition of 'constraint' in that specification.
OverconstrainedError.message - Web APIs
the message read-only property of the overconstrained
error interface returns the text supplied in the constructor.
... syntax var message = overconstrained
error.message; value a domstring.
OverconstrainedError.name - Web APIs
the name read-only property of the overconstrained
error interface will always return 'overconstrained
error'.
... syntax var name = overconstrained
error.name; value a domstring.
SpeechRecognition: error event - Web APIs
the
error event of the web speech api speechrecognition object is fired when a speech recognition
error occurs.
... bubbles no cancelable no interface speechrecognition
errorevent event handler property on
error examples you can use the
error event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('
error', function(event) { console.log('speech recognition
error detected: ' + event.
error'); }); or use the on
error event handler property: recognition.on
error = function(event) { console.log('speech recognition
error detected: ' + event.
error'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification.
SpeechRecognition.onerror - Web APIs
the on
error property of the speechrecognition interface represents an event handler that will run when a speech recognition
error occurs (when the
error event fires.) syntax myspeechrecognition.on
error = function() { ...
... }; examples var recognition = new speechrecognition(); recognition.on
error = function(event) { console.log('speech recognition
error detected: ' + event.
error); } specifications specification status comment web speech apithe definition of 'on
error' in that specification.
SpeechSynthesisUtterance: error event - Web APIs
the
error event of the web speech api speechsynthesisutterance object is fired when an
error occurs that prevents the utterance from being succesfully spoken.
... bubbles no cancelable no interface speechsynthesis
errorevent event handler property on
error examples you can use the
error event in an addeventlistener method: utterthis.addeventlistener('
error', function(event) { console.log('an
error has occurred with the speech synthesis: ' + event.
error'); }); or use the on
error event handler property: utterthis.on
error = function(event) { console.log('an
error has occurred with the speech synthesis: ' + event.
error'); } specifications specification status comment web speech apithe definition of 'speech synthesis utterance events' in that specification.
SpeechSynthesisUtterance.onerror - Web APIs
the on
error property of the speechsynthesisutterance interface represents an event handler that will run when an
error occurs that prevents the utterance from being succesfully spoken (when the
error event fires.) syntax speechsynthesisutteranceinstance.on
error = function() { ...
... inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.on
error = function(event) { console.log('an
error has occurred with the speech synthesis: ' + event.
error); } inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'on
error' in that specification.
WebSocket: error event - Web APIs
the
error event is fired when a connection with a websocket has been closed due to an
error (some data couldn't be sent for example).
... bubbles no cancelable no interface event event handler property on
error examples // create websocket connection const socket = new websocket('ws://localhost:8080'); // listen for possible
errors socket.addeventlistener('
error', function (event) { console.log('websocket
error: ', event); }); specifications specification status html living standardthe definition of 'websocket
error' in that specification.
Window: messageerror event - Web APIs
the message
error event is fired on a window object when it receives a message that can't be deserialized.
... bubbles no cancelable no interface messageevent event handler property onmessage
error examples listen for message
error using addeventlistener(): window.addeventlistener('message
error', (event) => { console.
error(event); }); the same, but using the onmessage
error event handler property: window.onmessage
error = (event) => { console.
error(event); }; specifications specification status html living standard living standard ...
TypeError: invalid Array.prototype.sort argument - JavaScript
message type
error: argument is not a function object (edge) type
error: invalid array.prototype.sort argument (firefox)
error type type
error what went wrong?
... examples invalid cases [1, 3, 2].sort(5); // type
error var cmp = { asc: (x, y) => x >= y, dsc: (x, y) => x <= y }; [1, 3, 2].sort(cmp[this.key] || 'asc'); // type
error valid cases [1, 3, 2].sort(); // [1, 2, 3] var cmp = { asc: (x, y) => x >= y, dsc: (x, y) => x <= y }; [1, 3, 2].sort(cmp[this.key || 'asc']); // [1, 2, 3] ...
SyntaxError: return not in function - JavaScript
message syntax
error: 'return' statement outside of function (edge) syntax
error: return not in function (firefox) syntax
error: yield not in function (firefox)
error type syntax
error.
... examples missing curly brackets var cheer = function(score) { if (score === 147) return 'maximum!'; }; if (score > 100) { return 'century!'; } } // syntax
error: return not in function the curly brackets look correct at a first glance, but this code snippet is missing a { after the first if statement.
TypeError: X.prototype.y called on incompatible type - JavaScript
message type
error: 'this' is not a set object (edge) type
error: function.prototype.tostring called on incompatible object (firefox) type
error: function.prototype.bind called on incompatible target (firefox) type
error: method set.prototype.add called on incompatible receiver undefined (chrome) type
error: bind must be called on a function (chrome)
error type type
error what went wrong?
... when this
error is thrown, a function (on a given object), is called with a this not corresponding to the type expected by the function.
ReferenceError: can't access lexical declaration`X' before initialization - JavaScript
message reference
error: use before delaration (edge) reference
error: can't access lexical declaration `x' before initialization (firefox) reference
error: 'x' is not defined (chrome)
error type reference
error what went wrong?
... function test() { let foo = 33; if (true) { let foo = (foo + 55); // reference
error: can't access lexical // declaration `foo' before initialization } } test(); valid cases to change "foo" inside the if statement, you need to remove the let that causes the redeclaration.
TypeError: can't access property "x" of "y" - JavaScript
message type
error: unable to get property {x} of undefined or null reference (edge) type
error: can't access property {x} of {y} (firefox) type
error: {y} is undefined, can't access property {x} of it (firefox) type
error: {y} is null, can't access property {x} of it (firefox) examples: type
error: x is undefined, can't access property "prop" of it type
error: x is null, can't access property "prop" of it type
error: can't access property "prop" of undefined type
error: can't access property "prop" of null
error type type
error.
... examples invalid cases // undefined and null cases on which the substring method won't work var foo = undefined; foo.substring(1); // type
error: x is undefined, can't access property "substring" of it var foo = null; foo.substring(1); // type
error: x is null, can't access property "substring" of it fixing the issue to fix null pointer to undefined or null values, you can use the typeof operator, for example.
TypeError: can't redefine non-configurable property "x" - JavaScript
message type
error: cannot modify non-writable property {x} (edge) type
error: can't redefine non-configurable property "x" (firefox) type
error: cannot redefine property: "x" (chrome)
error type type
error what went wrong?
... var obj = object.create({}); object.defineproperty(obj, "foo", {value: "bar"}); object.defineproperty(obj, "foo", {value: "baz"}); // type
error: can't redefine non-configurable property "foo" you will need to set the "foo" property to configurable, if you intend to redefine it later in the code.
TypeError: cyclic object value - JavaScript
message type
error: cyclic object value (firefox) type
error: converting circular structure to json (chrome and opera) type
error: circular reference in value argument not supported (edge)
error type type
error what went wrong?
... examples circular references in a circular structure like the following var circularreference = {otherdata: 123}; circularreference.myself = circularreference; json.stringify() will fail json.stringify(circularreference); // type
error: cyclic object value to serialize circular references you can use a library that supports them (e.g.
SyntaxError: identifier starts immediately after numeric literal - JavaScript
message syntax
error: unexpected identifier after numeric literal (edge) syntax
error: identifier starts immediately after numeric literal (firefox) syntax
error: unexpected number (chrome)
error type syntax
error what went wrong?
...the following fails: var 1life = 'foo'; // syntax
error: identifier starts immediately after numeric literal var foo = 1life; // syntax
error: identifier starts immediately after numeric literal alert(1.foo); // syntax
error: identifier starts immediately after numeric literal you will need to rename your variable to avoid the leading number.
ReferenceError: invalid assignment left-hand side - JavaScript
message reference
error: invalid assignment left-hand side
error type reference
error.
... examples typical invalid assignments if (math.pi = 3 || math.pi = 4) { console.log('no way!'); } // reference
error: invalid assignment left-hand side var str = 'hello, ' += 'is it me ' += 'you\'re looking for?'; // reference
error: invalid assignment left-hand side in the if statement, you want to use a comparison operator ("=="), and for the string concatenation, the plus ("+") operator is needed.
RangeError: invalid date - JavaScript
message range
error: invalid date (edge) range
error: invalid date (firefox) range
error: invalid time value (chrome) range
error: provided date is not in valid range (chrome)
error type range
error what went wrong?
...however, depending on the implementation, non–conforming iso format strings, may also throw range
error: invalid date, like the following cases in firefox: new date('foo-bar 2014'); new date('2014-25-23').toisostring(); new date('foo-bar 2014').tostring(); this, however, returns nan in firefox: date.parse('foo-bar 2014'); // nan for more details, see the date.parse() documentation.
SyntaxError: missing } after function body - JavaScript
message syntax
error: expected '}' (edge) syntax
error: missing } after function body (firefox)
error type syntax
error what went wrong?
... (function() { if (true) { return false; } ); oftentimes, indenting differently or double checking indentation helps to spot these
errors.
SyntaxError: missing formal parameter - JavaScript
message syntax
error: missing formal parameter (firefox)
error type syntax
error what went wrong?
...all these function declarations fail, as they are providing values for their parameters: function square(3) { return number * number; }; // syntax
error: missing formal parameter function greet("howdy") { return greeting; }; // syntax
error: missing formal parameter function log({ obj: "value"}) { console.log(arg) }; // syntax
error: missing formal parameter you will need to use identifiers in function declarations: function square(number) { return number * number; }; function greet(greeting) { return greeting; }; function log(arg) {...
SyntaxError: missing = in const declaration - JavaScript
message syntax
error: const must be initalized (edge) syntax
error: missing = in const declaration (firefox) syntax
error: missing initializer in const declaration (chrome)
error type syntax
error what went wrong?
...this throws: const columns; // syntax
error: missing = in const declaration fixing the
error there are multiple options to fix this
error.
RangeError: repeat count must be non-negative - JavaScript
message range
error: argument out of range range
error: repeat count must be non-negative (firefox) range
error: invalid count value (chrome)
error type range
error what went wrong?
... examples invalid cases 'abc'.repeat(-1); // range
error valid cases 'abc'.repeat(0); // '' 'abc'.repeat(1); // 'abc' 'abc'.repeat(2); // 'abcabc' 'abc'.repeat(3.5); // 'abcabcabc' (count will be converted to integer) ...
TypeError: "x" has no properties - JavaScript
message type
error: unable to get property {x} of undefined or null reference (edge) type
error: null has no properties (firefox) type
error: undefined has no properties (firefox)
error type type
error.
... examples null and undefined have no properties null.foo; // type
error: null has no properties undefined.bar; // type
error: undefined has no properties ...
RangeError: precision is out of range - JavaScript
message range
error: the number of fractional digits is out of range (edge) range
error: the precision is out of range (edge) range
error: precision {0} out of range (firefox) range
error: toexponential() argument must be between 0 and 20 (chrome) range
error: tofixed() digits argument must be between 0 and 20 (chrome) range
error: toprecision() argument must be between 1 and 21 (chrome)
error type range
error what went wrong?
... method firefox (spidermonkey) chrome, opera (v8) number.prototype.toexponential() 0 to 100 0 to 20 number.prototype.tofixed() -20 to 100 0 to 20 number.prototype.toprecision() 1 to 100 1 to 21 examples invalid cases 77.1234.toexponential(-1); // range
error 77.1234.toexponential(101); // range
error 2.34.tofixed(-100); // range
error 2.34.tofixed(1001); // range
error 1234.5.toprecision(-1); // range
error 1234.5.toprecision(101); // range
error valid cases 77.1234.toexponential(4); // 7.7123e+1 77.1234.toexponential(2); // 7.71e+1 2.34.tofixed(1); // 2.3 2.35.tofixed(1); // 2.4 (note that it rounds up in this case) 5.123456...
Error: Permission denied to access property "x" - JavaScript
message
error: permission denied to access property "x"
error type
error.
... examples no permission to access document <!doctype html> <html> <head> <iframe id="myframe" src="http://www1.w3c-test.org/common/blank.html"></iframe> <script> onload = function() { console.log(frames[0].document); //
error: permission denied to access property "document" } </script> </head> <body></body> </html> ...
SyntaxError: redeclaration of formal parameter "x" - JavaScript
message syntax
error: let/const redeclaration (edge) syntax
error: redeclaration of formal parameter "x" (firefox) syntax
error: identifier "x" has already been declared (chrome)
error type syntax
error what went wrong?
... function f(arg) { let arg = 'foo'; } // syntax
error: redeclaration of formal parameter "arg" if you want to change the value of "arg" in the function body, you can do so, but you do not need to declare the same variable again.
RangeError: repeat count must be less than infinity - JavaScript
message range
error: argument out of range (edge) range
error: repeat count must be less than infinity and not overflow maximum string size (firefox) range
error: invalid count value (chrome)
error type range
error what went wrong?
... examples invalid cases 'abc'.repeat(infinity); // range
error 'a'.repeat(2**28); // range
error valid cases 'abc'.repeat(0); // '' 'abc'.repeat(1); // 'abc' 'abc'.repeat(2); // 'abcabc' 'abc'.repeat(3.5); // 'abcabcabc' (count will be converted to integer) ...
TypeError: invalid arguments - JavaScript
message type
error: invalid arguments (firefox)
error type type
error what went wrong?
... var ta = new uint8array("nope"); // type
error: invalid arguments different ways to create a valid uint8array: // from a length var uint8 = new uint8array(2); uint8[0] = 42; console.log(uint8[0]); // 42 console.log(uint8.length); // 2 console.log(uint8.bytes_per_element); // 1 // from an array var arr = new uint8array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint8array([21, 31]); var y = new uint8array(...
TypeError: "x" is (not) "y" - JavaScript
message type
error: unable to get property {x} of undefined or null reference (edge) type
error: "x" is (not) "y" (firefox) examples: type
error: "x" is undefined type
error: "x" is null type
error: "undefined" is not an object type
error: "x" is not an object or null type
error: "x" is not a symbol
error type type
error.
... examples invalid cases // undefined and null cases on which the substring method won't work var foo = undefined; foo.substring(1); // type
error: foo is undefined var foo = null; foo.substring(1); // type
error: foo is null // certain methods might require a specific type var foo = {} symbol.keyfor(foo); // type
error: foo is not a symbol var foo = 'bar' object.create(foo); // type
error: "foo" is not an object or null fixing the issue to fix null pointer to undefined values, you can use the typeof operator, for example.
TypeError: invalid 'instanceof' operand 'x' - JavaScript
message type
error: invalid 'instanceof' operand "x" (firefox) type
error: "x" is not a function (firefox) type
error: right-hand side of 'instanceof' is not an object (chrome) type
error: right-hand side of 'instanceof' is not callable (chrome)
error type type
error what went wrong?
... examples instanceof vs typeof "test" instanceof ""; // type
error: invalid 'instanceof' operand "" 42 instanceof 0; // type
error: invalid 'instanceof' operand 0 function foo() {} var f = foo(); // foo() is called and returns undefined var x = new foo(); x instanceof f; // type
error: invalid 'instanceof' operand f x instanceof x; // type
error: x is not a function to fix these
errors, you will either need to replace the instanceof operator with the typeof operator, or to make sure you use the function name, instead of the result of its evaluation.
Error.prototype.columnNumber - JavaScript
the columnnumber property contains the column number in the line of the file that raised this
error.
... examples using columnnumber var e = new
error('could not parse input'); throw e; console.log(e.columnnumber) // 0 specifications not part of any standard.
Error.prototype.lineNumber - JavaScript
the linenumber property contains the line number in the file that raised this
error.
... examples using linenumber var e = new
error('could not parse input'); throw e; console.log(e.linenumber) // 2 alternative example using
error event window.addeventlistener('
error', function(e) { console.log(e.linenumber); // 5 }); var e = new
error('could not parse input'); throw e; this is not a standard feature and lacks widespread support.
Errors
this page lists the
errors that can be raised due to firefox's anti-tracking functionality, governed by the storage access policy.
onerror - Web APIs
the filereader on
error handler receives an event object, not an
error object, as a parameter, but an
error can be accessed from the filereader object, as instanceoffilereader.
error // callback from a <input type="file" onchange="onchange(event)"> function onchange(event) { var file = event.target.files[0]; var reader = new filereader(); reader.on
error = function(event) { alert("failed to read file!\n\n" + reader.
error); reader.abort(); // (...does this do anything useful in an on
error handler?) }; reader.readastext(file); } ...
RangeError: radix must be an integer - JavaScript
message range
error: invalid argument (edge) range
error: radix must be an integer at least 2 and no greater than 36 (firefox) range
error: tostring() radix argument must be between 2 and 36 (chrome)
error type range
error what went wrong?
RangeError: invalid array length - JavaScript
message range
error: array length must be a finite positive integer (edge) range
error: invalid array length (firefox) range
error: invalid array length (chrome) range
error: invalid array buffer length (chrome)
error type range
error what went wrong?
Index - Web APIs
23 abstractworker.on
error api, abstractworker, eventhandler, property, reference, web workers, workers, on
error the abstractworker.on
error property of the abstractworker interface represents an eventhandler, that is a function to be called when the
error event occurs and bubbles through the worker.
... 29 address
errors api, address, address
errors, dictionary,
errors, interface, payment address, payment request, payment request api, reference, payment, paymentaddress the address
errors dictionary is used by the payment request api to to report validation
errors in a physical address (typically a billing address or a shipping address).
... 30 address
errors.addressline api, address
errors,
error, payment request, payment request api, property, reference, validation, addressline, payment an object based on address
errors includes an addressline property when validation of the address finds one or more
errors in the array of strings in the address's addressline.
...And 196 more matches
sslerr.html
upgraded documentation may be found in the current nss reference nss and ssl
error codes chapter 8 nss and ssl
error codes nss
error codes are retrieved using the nspr function pr_get
error.
... in addition to the
error codes defined by nspr, pr_get
error retrieves the
error codes described in this chapter.
... ssl
error codes sec
error codes ssl
error codes table 8.1
error codes defined in sslerr.h constant value description ssl_
error_export_only_server -12288 "unable to communicate securely.
...And 165 more matches
HTTP Index - HTTP
21 cors
errors cors,
errors, http, https, messages, same-origin, security, console, troubleshooting cross-origin resource sharing (cors) is a standard that allows a server to relax the same-origin policy.
... 22 reason: cors disabled authentication, authentication article, cors, cross-origin, disabled,
errors, http, https, messages, resource, same origin, same-origin, security, sharing, validation, secure, troubleshooting a request that needs to use cors was attempted, but cors is disabled in the user's browser.
... 23 reason: cors header 'access-control-allow-origin' does not match 'xyz' cors, corsalloworiginnotmatchingorigin, cross-origin,
error, http, https, messages, reasons, security, console, troubleshooting simply put, the origin making the request does not match any of the origins permitted by the access-control-allow-origin header.
...And 63 more matches
What went wrong? Troubleshooting JavaScript - Learn web development
never fear — this article aims to save you from tearing your hair out over such problems by providing you with some tips on how to find and fix
errors in javascript programs.
... types of
error generally speaking, when you do something wrong in code, there are two main types of
error that you'll come across: syntax
errors: these are spelling
errors in your code that actually cause the program not to run at all, or stop working part way through — you will usually be provided with some
error messages too.
... these are usually okay to fix, as long as you are familiar with the right tools and know what the
error messages mean!
...And 46 more matches
sslfnc.html
use pr_get
error to retrieve the
error code.
...use pr_get
error to retrieve the
error code.
...use pr_get
error to retrieve the
error code.
...And 42 more matches
Client-side form validation - Learn web development
if the information is correctly formatted, the application allows the data to be submitted to the server and (usually) saved in a database; if the information isn't correctly formatted, it gives the user an
error message explaining what needs to be corrected, and lets them try again.
... when an element is invalid, the following things are true: the element matches the :invalid css pseudo-class, and sometimes other ui pseudo-classes (e.g., :out-of-range) depending on the
error, which lets you apply a specific style to invalid elements.
... if the user tries to send the data, the browser will block the form and display an
error message.
...And 39 more matches
Bytecode Descriptions
this is how we implement typeof step 2, making typeof nonexistingvariable return "undefined" instead of throwing a reference
error.
...per spec, the latter throws a reference
error if x doesn't exist.
...this throws a type
error if target is not an object.
...And 37 more matches
DOMException - Web APIs
this is basically how
error conditions are described in web apis.
... each exception has a name, which is a short "camelcase" style string identifying the
error or abnormal condition.
... properties domexception.code read only returns a short that contains one of the
error code constants, or 0 if none match.
...And 37 more matches
nsIFile
exceptions thrown ns_
error_file_not_directory indicates that this nsifile does not reference a directory.
... exceptions thrown ns_
error_file_invalid_path indicates that this nsifile does not reference a symbolic link.
... exceptions thrown ns_
error_file_unrecognized_path indicates that anode incorrectly contains a path separator character.
...And 36 more matches
Index
36 js::create
error jsapi reference, reference, référence(2), spidermonkey js::create
error creates an
error object with specified properties.
...the allocation will then be retried (and may still fail.) 68 js::setoutofmemorycallback jsapi reference, reference, référence(2), spidermonkey unlike the
error reporter, which is only called if the exception for an oom bubbles up and is not caught, the js::outofmemorycallback is called immediately at the oom site to allow the embedding to capture the current state of heap allocation before anything is freed.
... 89 jscheckaccessop jsapi reference, obsolete, reference, référence(2), spidermonkey check whether obj[id] may be accessed per mode, returning js_false on
error/exception, js_true on success with obj[id]'s stored value in *vp.
...And 35 more matches
Using IndexedDB - Web APIs
the call to the open() function returns an idbopendbrequest object with a result (success) or
error value that you handle as an event.
... most other asynchronous functions in indexeddb do the same thing - return an idbrequest object with the result or
error.
...so for example, don't use 2.4 as a version number: var request = indexeddb.open("mytestdatabase", 2.4); // don't do this, as the version will be rounded to 2 generating handlers the first thing you'll want to do with almost all of the requests you generate is to add success and
error handlers: request.on
error = function(event) { // do something with request.
errorcode!
...And 35 more matches
nsIZipWriter
operations performed on the queue throw any
errors that occur out to the observer.
... attempting to perform a synchronous operation on the interface while the background queue is in progress will throw an ns_
error_in_progress exception.
... exceptions thrown ns_
error_not_initialized if no zip file has been opened.
...And 33 more matches
WebIDL bindings
in addition to those, all methods that are allowed to throw will get an
errorresult& argument appended to their argument list.
...r(any something); void doyetanotherthing(optional boolean actuallydoit = false); static void staticoperation(any arg); }; will require these method declarations: class myclass { void dosomething(int32_t anumber); double dosomething(myclass* aotherinstance); already_addrefed<myinterface> dosomethingelse(optional<int32_t> amaybenumber,
errorresult& rv); void dosomethingelse(myclass& aotherinstance,
errorresult& rv); void dotheother(jscontext* cx, js::value asomething); void doyetanotherthing(bool aactuallydoit); static void staticoperation(const globalobject& aglobal, js::value asomething); } c++ reflections of webidl attributes a webidl attribute is turned into a pair of method calls for the getter and setter on the un...
... for example, this idl: [constructor, constructor(unsigned long somenumber)] interface myinterface { }; will require the following declarations in myclass: class myclass { // various nsisupports stuff or whatnot static already_addrefed<myclass> constructor(const globalobject& aglobal,
errorresult& rv); static already_addrefed<myclass> constructor(const globalobject& aglobal, uint32_t asomenumber,
errorresult& rv); }; c++ reflections of webidl types the exact c++ representation for webidl types can depend on the precise way that they're being used (e.g., return values, arguments, and sequence or di...
...And 33 more matches
OS.File for the main thread
a file is a directory the following snippet determines if some path represents a file or a directory: let promise = os.file.stat(somepath); promise = promise.then( function onsuccess(stat) { if (stat.isdir) { // the path represents a directory } else { // the path represents a file, not a directory } }, function onfailure(reason) { if (reason instanceof os.file.
error && reason.becausenosuchfile) { // the file does not exist } else { // some other
error throw reason; } } ); example: copy a file by chunks the following snippet writes a (presumably large) buffer by chunks.
... file.close(); }, function on
error(reason) { file.close(); throw reason; }); return promise; } or a variant using task.js (or at least the subset already present on mozilla-central): let writestream = function writestream(data, outfile, chunksize) { return task.spawn(function() { let view = new uint8array(data); let pos = 0; while (pos < view.bytelength) { pos += yield outfile.write(view.subarray...
...if the file already exists, throw an
error.
...And 29 more matches
JSAPI User Guide
error reporting is also per-context and is enabled using js_set
errorreporter.
...static jsclass globalclass = { "global", jsclass_global_flags, js_propertystub, js_deletepropertystub, js_propertystub, js_strictpropertystub, js_enumeratestub, js_resolvestub, js_convertstub, nullptr, nullptr, nullptr, nullptr, js_globalobjecttracehook }; // the
error reporter callback.
... void report
error(jscontext *cx, const char *message, js
errorreport *report) { fprintf(stderr, "%s:%u:%s\n", report->filename ?
...And 29 more matches
Index
14 introduction to xpcom for the dom developing mozilla warning: this document has not yet been reviewed by the dom gurus, it might contain some
errors.
...these exception objects may be thrown when implementing xpcom interfaces in javascript, and they can provide better diagnostics in the
error console if not caught than simply throwing an nsresult's value will.
... 27 components.results xpcom:language bindings, xpconnect components.results is a read-only object whose properties are the names listed as the first parameters of the macros in js/xpconnect/src/xpc.msg (also at table of
errors), with the value of each corresponding to that constant's value.
...And 29 more matches
Template Logging - Archive of obsolete content
« previous debugging problems with a template can be difficult as many problems are logic
errors that are often not possible to determine automatically.
... for example, if you spell a value wrong, no data may be returned, but the template system won't know that that this was because of a spelling
error, or simply that there shouldn't be any data anyway.
...logging template results there are two main ways in which template
errors may be detected.
...And 28 more matches
Examples
how to throw reject if you have a function that is a promise, and want to end it and throw a reject, you can throw an
error.
... components.utils.import("resource://gre/modules/osfile.jsm") let path = os.path.join(os.constants.path.tmpdir, "file.txt"); let promise = os.file.exists(path); let newpromise = promise.then(function onfulfill(aexists) { if (aexists) { console.log("you have file.txt in your temporary directory."); } else { throw new
error("you don't have file.txt in your temporary directory."); } }); // unexpected
errors should always be reported at the end of a promise chain.
...ls.import("resource://gre/modules/osfile.jsm") let path = os.path.join(os.constants.path.tmpdir, "file.txt"); let promise = os.file.exists(path); let newpromise = promise.then(function onfulfill(aexists) { if (aexists) { console.log("you have file.txt in your temporary directory."); } else { console.log("you don't have file.txt in your temporary directory."); } }); // unexpected
errors should always be reported at the end of a promise chain.
...And 28 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
ref: bug 690370 available functions are (see prefcalls.js file for details): function getprefbranch() function pref(prefname, value) function defaultpref(prefname, value) function lockpref(prefname, value) function unlockpref(prefname) function getpref(prefname) function getldapattributes(host, base, filter, attribs) function getldapvalue(str, key) function display
error(funcname, message) function getenv(name) configure autoconfig two directives ask thunderbird to use autoconfig at startup: # cat /usr/lib/thunderbird/defaults/pref/tb-autoconf.js // 20100526 - modification autoconfig jehan.
...lockpref("mail.identity.id1.useremail", mail); lockpref("mail.server.server2.name", mail); lockpref("mail.identity.id1.fullname", cn); //debug with popup
error messages doesn't work anymore :-( !!
... var env_mozdebug= getenv("mozilla_debug"); if (env_mozdebug) {display
error("no
error, just a debug, cn =" + cn + " and mail = " + mail); } } } // 4) call ldap servers to get ldap attributes (mail & cn), this will finally call processldapvalues, "3)" just above.
...And 26 more matches
Strict mode - JavaScript
strict mode makes several changes to normal javascript semantics: eliminates some javascript silent
errors by changing them to throw
errors.
...changes generally fall into these categories: changes converting mistakes into
errors (as syntax
errors or at runtime), changes simplifying how the particular variable for a given use of a name is computed, changes simplifying eval and arguments, changes making it easier to write "secure" javascript, and changes anticipating future ecmascript evolution.
... converting mistakes into
errors strict mode changes some previously-accepted mistakes into
errors.
...And 25 more matches
nsIHttpChannel
exceptions thrown ns_
error_failure if set after the channel has been opened.
...if zero, the channel will fail to redirect and will generate a ns_
error_redirect_loop failure status.
... exceptions thrown ns_
error_in_progress if set after the channel has been opened.
...And 24 more matches
Debugging HTML - Learn web development
previous overview: introduction to html next writing html is fine, but what if something goes wrong, and you can't work out where the
error in the code is?
... this article will introduce you to some tools that can help you find and fix
errors in html.
... debugging isn't scary when writing code of some kind, everything is usually fine, until that dreaded moment when an
error occurs — you've done something wrong, so your code doesn't work — either not at all, or not quite how you wanted it to.
...And 23 more matches
Graceful asynchronous programming with Promises - Learn web development
this uses setstatusmessage() to update the status box to indicate that an
error occurred.
...using asynchronous promises instead, we'd end up with something like this: choosetoppings() .then(function(toppings) { return placeorder(toppings); }) .then(function(order) { return collectorder(order); }) .then(function(pizza) { eatpizza(pizza); }) .catch(failurecallback); this is much better — it is easier to see what is going on, we only need a single .catch() block to handle all the
errors, it doesn't block the main thread (so we can keep playing video games while we wait for the pizza to be ready to collect), and each operation is guaranteed to wait for previous operations to complete before running.
...fetch promises do not fail on 404 or 500
errors — only on something catasrophic like a network failure.
...And 22 more matches
Event reference
most common categories resource events event name fired when
error a resource failed to load.
...
error a websocket connection has been closed with prejudice (some data couldn't be sent for example).
... fullscreen
error it was impossible to switch to fullscreen mode for technical reasons or because the permission was denied.
...And 21 more matches
Index - Archive of obsolete content
2 .htaccess ( hypertext access ) 301 redirect, cache control, custom
error pages, htaccess, permanent redirect, redirect file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any other.
... 136 console add-on sdk enables your add-on to log
error, warning or informational messages.
...in calling this method, the editor is created underneath and the event listeners are all prepa if (ns_failed(rv)) return ns_
error_failure; // we are not setup??!!
...And 20 more matches
Install script template - Archive of obsolete content
suffix = "my"; var suffix_description = "my plugin files"; var company_name = "mypluginco"; var plugin_description = "my exemplary plugin mine all mine"; // registry constant paths // these will be used when the win32 registry keys are written var hkey_local_machine = "hkey_local_machine"; var hkey_current_user = "hkey_current_user"; var reg_moz_path = "software\\mozillaplugins"; // my own
error code in case secondary installation fails var nosecondaryinstall = 1; //
error return codes need some memory var err; //
error return codes when we try and install to the current browser var errblock1; //
error return codes when we try and do a secondary installation var errblock2 = 0; // global variable containing our secondary install location var secondaryfolder; //special
error value...
...s used by the cycore developers (www.cycore.com) who helped make this install script var exceptionoccured
error = -4711; var winregisnull
error = -4712; var invalidrootkey
error = -4713; var registrykeynotwritable
error = -4714; //initinstall block //the installation is initialized here -- if we fail here, cancel the installation // initinstall is quite an overloaded method, but i have invoked it here with three strings // which are globally defined err = initinstall(software_name, plid, version); if (err != 0) { // call initinstall again in case illegal characters in plid err = initinstall(software_name, software_name, version); if (err != 0) cancelinstall(err); } //addfiles to current browser block var pluginsfolder = getfolder("plugins"); //verify disk s...
...pace if(verifydiskspace(pluginsfolder, plugin_size+component_size)) { // start installing plugin shared library reset
error(); // install the plugin shared library to the current browser's plugin directory errblock1 = addfile (plid, version, plugin_file, pluginsfolder, null); if (errblock1!=0) { logcomment("could not add " + plugin_file + " to " + pluginsfolder + ":" + errblock1); cancelinstall(errblock1); } // start installing xpt file if this is a scriptable plugin // install to the plugins directory -- this works well in mozilla 1.0 clients // in mozilla 1.0 clients, the components directory can be avoided for xpt files errblock1 = addfile (plid, version, component_file, pluginsfolder, null); if (errblock1!=0) { logcomment("could not add " + component_file + " to " +...
...And 20 more matches
TypeScript support in Svelte - Learn web development
one of the big benefits is enabling ides to provide a richer environment for spotting common
errors as you type the code.
... typescript's main advantages are: early spotted bugs: the compiler checks types at compile time and provides
error reporting.
... note: if you don't wish to use vs code, we also provide instructions for using typescript
error checking from the terminal instead, slightly later on.
...And 19 more matches
nsIDOMWindowUtils
exceptions thrown ns_
error_not_available there is no current inner window displaydpi float the dpi of the display.
...throws ns_
error_not_available if the count can't be provided.
...throws an
error if there is no widget associated with this window.
...And 19 more matches
MediaDevices.getUserMedia() - Web APIs
if the user denies permission, or matching media is not available, then the promise is rejected with notallowed
error or notfound
error respectively.
... generally, you will access the mediadevices singleton object using navigator.mediadevices, like this: async function getmedia(constraints) { let stream = null; try { stream = await navigator.mediadevices.getusermedia(constraints); /* use the stream */ } catch(err) { /* handle the
error */ } } similarly, using the raw promises directly, the code looks like this: navigator.mediadevices.getusermedia(constraints) .then(function(stream) { /* use the stream */ }) .catch(function(err) { /* handle the
error */ }); note: if the current document isn't loaded securely, navigator.mediadevices will be undefined, and you cannot use getusermedia().
...if the browser cannot find all media tracks with the specified types that meet the constraints given, then the returned promise is rejected with notfound
error.
...And 18 more matches
Web Console remoting - Firefox Developer Tools
these can be: page
errors, window.console api messages, network activity, and file activity.
... for example: ["page
error", "consoleapi", "networkactivity", "fileactivity"] the web console actor does not start any listeners by default.
...when you attach to the global consoleactor you receive all of the network requests, page
errors, and the other events from all of the tabs and windows, including chrome
errors and network events.
...And 16 more matches
PromiseWorker.jsm
various
error objects are supported; each one has its specific meaning; they're described below.
... supported built-in javascript
error are following: eval
error internal
error range
error reference
error syntax
error type
error uri
error in addition to them, stopiteration is also supported (note that stopiteration is deprecated).
... you can also construct and throw your own custom
error objects as needed.
...And 15 more matches
sample2
*/ /* nspr headers */ #include <prthread.h> #include <plgetopt.h> #include <pr
error.h> #include <prinit.h> #include <prlog.h> #include <prtypes.h> #include <plstr.h> /* nss headers */ #include <cryptohi.h> #include <keyhi.h> #include <pk11priv.h> #include <cert.h> #include <base64.h> #include <secerr.h> #include <secport.h> #include <secoid.h> #include <secmodt.h> #include <secoidt.h> #include <sechash.h> /* our samples utilities */ #include "util.h" /* constants */ #define blocksize 32 #define modblocksize 128 #define default_key_bits 1024 /* header file constants */ #define enckey_h...
...ficate for signature verification-----" #define ns_cert_vfy_trailer "-----end certificate for signature verification-----" #define ns_sig_header "-----begin signature-----" #define ns_sig_trailer "-----end signature-----" #define ns_cert_header "-----begin certificate-----" #define ns_cert_trailer "-----end certificate-----" /* missing publically from nss versions earlier than 3.13 */ #ifndef sec_
error_base #define sec_
error_base (-0x2000) typedef enum { sec_
error_io = sec_
error_base + 0, sec_
error_token_not_logged_in = (sec_
error_base + 155), sec_
error_end_of_list } sec
errorcodes; #endif /* port_
errortostring introduced in nss 3.13.
... on earlier versions of nss that * don't support
error tables, pr_
errortostring will return "unknown code".
...And 15 more matches
JSAPI Cookbook
*/ js::rootedvalue constructor_val(cx); if (!js_getproperty(cx, js_getglobalobject(cx), "person", &constructor_val)) return false; if (!constructor_val.isobject()) { js_report
error(cx, "person is not a constructor"); return false; } js::rootedobject constructor(cx, &constructor_val.toobject()); /* step 2 - set up the arguments.
... */ js::callargs args = js::callargsfromvp(argc, vp); args.rval().setint32(23); return true; returning a floating-point number // javascript return 3.14159; /* jsapi */ js::callargs args = js::callargsfromvp(argc, vp); args.rval().setdouble(3.14159); exception handling throw the most common idiom is to create a new
error object and throw that.
... js_report
error does this.
...And 15 more matches
Using Web Workers - Web APIs
thus, using the window shortcut to get the current global scope (instead of self) within a worker will return an
error.
... worker feature detection for slightly more controlled
error handling and backwards compatibility, it is a good idea to wrap your worker accessing code in the following (main.js): if (window.worker) { ...
... handling
errors when a runtime
error occurs in the worker, its on
error event handler is called.
...And 15 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
on form submission, if there is a form control that fails constraint validation, supporting browsers will display an
error message on the first invalid form control; displaying a default message based on the
error type, or a message set by you.
...several
errors could occur, including a rangeunderflow
error if the value is less than 2, rangeoverflow if greater than 10, stepmismatch if the value is a number between 2 and 10, but not an even integer (does not match the requirements of the step attribute), or typemismatch if the value is not a number.
...this is particularly useful for dates and times, such as when you want to allow the range to be from 8 pm to 8 am: <input type="time" min="20:00" max="08:00" name="overnight"> specific attributes and their values can lead to a specific
error validitystate: validity object
errors depend on the <input> attributes and their values: attribute relevent property description max validitystate.rangeoverflow occurs when the value is greater than the maximum value as defined by the max attribute maxlength validitystate.toolong occurs when the number of characters is greater than the number all...
...And 15 more matches
Using Promises - JavaScript
imagine a function, createaudiofileasync(), which asynchronously generates a sound file given a configuration record and two callback functions, one called if the audio file is successfully created, and the other called if an
error occurs.
... here's some code that uses createaudiofileasync(): function successcallback(result) { console.log("audio file ready at url: " + result); } function failurecallback(
error) { console.
error("
error generating audio file: " +
error); } createaudiofileasync(audiosettings, successcallback, failurecallback); modern functions return a promise that you can attach your callbacks to instead: if createaudiofileasync() were rewritten to return a promise, using it could be as simple as this: createaudiofileasync(audiosettings).then(successcallback, failurecallback); that's shorthand for: const promise = createaudiofileasync(audiosettings); promise.then(successcallback, failurecallback); we call this an asynchronous function call.
...read the following example: new promise((resolve, reject) => { console.log('initial'); resolve(); }) .then(() => { throw new
error('something failed'); console.log('do this'); }) .catch(() => { console.
error('do that'); }) .then(() => { console.log('do this, no matter what happened before'); }); this will output the following text: initial do that do this, no matter what happened before note: the text do this is not displayed because the something failed
error caused a rejection.
...And 15 more matches
Space Manager Detailed Design - Archive of obsolete content
the coordinate is * relative to the upper-left corner of the local coordinate space * @param amaxsize the size to use to constrain the band data * @param abanddata [in,out] used to return the list of trapezoids that * describe the available space and the unavailable space * @return ns_ok if successful and ns_
error_failure if the band data is not * not large enough.
...must not be null * @param aunavailablespace the bounding rect of the unavailable space * @return ns_ok if successful * ns_
error_failure if there is already a region tagged with aframe */ nsresult addrectregion(nsiframe* aframe, const nsrect& aunavailablespace); /** * resize the rectangular region associated with aframe by the specified * deltas.
...you specify whether the width change applies to the left or right edge * * returns ns_ok if successful, ns_
error_invalid_arg if there is no region * tagged with aframe */ enum affectededge {leftedge, rightedge}; nsresult resizerectregion(nsiframe* aframe, nscoord adeltawidth, nscoord adeltaheight, affectededge aedge = rightedge); /** * offset the region associated with aframe by the specified amount.
...And 14 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
responses to
error conditions become far more predictable.
... async function start() { try { const stream = await navigator.mediadevices.getusermedia(constraints); for (const track of stream.gettracks()) { pc.addtrack(track, stream); } selfvideo.srcobject = stream; } catch(err) { console.
error(err); } } this isn't appreciably different from older webrtc connection establishment code.
... let makingoffer = false; pc.onnegotiationneeded = async () => { try { makingoffer = true; await pc.setlocaldescription(); signaler.send({ description: pc.localdescription }); } catch(err) { console.
error(err); } finally { makingoffer = false; } }; note that setlocaldescription() without arguments automatically creates and sets the appropriate description based on the current signalingstate.
...And 14 more matches
core/promise - Archive of obsolete content
instead of structuring our programs into logical black boxes: function blackbox(a, b) { var c = assemble(a); return combine(b, c); } we're forced into continuation passing style, involving lots of machinery: function sphagetti(a, b, callback) { assemble(a, function continuewith(
error, c) { if (
error) callback(
error); else combine(b, c, callback); }); } this style also makes doing things in sequence hard: widget.on('click', function onclick() { promptuserfortwitterhandle(function continuewith(
error, handle) { if (
error) return ui.display
error(
error); twitter.gettweetsfor(handle, funtion continuewith(
error, tweets) { if (
error) return ui.display
error...
...(
error); ui.showtweets(tweets); }); }); }); doing things in parallel is even harder: var tweets, answers, checkins; twitter.gettweetsfor(user, function continuewith(result) { tweets = result; somethingfinished(); }); stackoverflow.getanswersfor(question, function continuewith(result) { answers = result; somethingfinished(); }); foursquare.getcheckinsby(user, function continuewith(result) { checkins=result; somethingfinished(); }); var finished = 0; function somethingfinished() { if (++finished === 3) ui.show(tweets, answers, checkins); } this also makes
error handling quite an adventure.
...however, if the returned promise gets rejected, the failure callback (the
error handler) will be called with the reason of an
error.
...And 13 more matches
An Overview of XPCOM
implementation of nsisupports interface // initialize the reference count to 0 sample::sample() : mrefcnt(0) { } sample::~sample() { } // typical, generic implementation of qi ns_imethodimp sample::queryinterface(const nsiid &aiid, void **aresult) { if (!aresult) { return ns_
error_null_pointer; } *aresult = null; if (aiid.equals(kisupportsiid)) { *aresult = (void *) this; } if (!*aresult) { return ns_
error_no_interface; } // add a reference addref(); return ns_ok; } ns_imethodimp_(nsrefcnt) sample::addref() { return ++mrefcnt; } ns_imethodimp_(nsrefcnt) sample::release() { if (--mrefcnt == 0) { delete this; return 0; } // optiona...
...in xpcom, all interface methods should return an nsresult
error value (see the xpcom api reference for a listing of these
error codes).
... these
error code results become the "exceptions" that xpcom handles.
...And 13 more matches
nsIConsoleService
xpcom/base/nsiconsoleservice.idlscriptable the console service is the back-end for the
error console, bundled with every mozilla application, and for firefox's web console and browser console.
... it is used to log various messages, warnings, and
errors and to obtain the logged messages.
... registerlistener() registers a listener, to notify when an
error is logged.
...And 13 more matches
Debugger.Object - Firefox Developer Tools
errormessagename if the referent is an
error created with an engine internal message template this is a string which is the name of the template; undefined otherwise.
...
errorlinenumber if the referent is an
error object, this is the line number at which the referent was created; undefined otherwise.
...
errorcolumnnumber if the referent is an
error object, this is the column number at which the referent was created; undefined otherwise.
...And 13 more matches
Handling common JavaScript problems - Learn web development
linters as with html and css, you can ensure better quality, less
error-prone javascript code using a linter, which points out
errors and can also flag up warnings about bad practices, etc., and be customized to be stricter or more relaxed in their
error/warning reporting.
... online the jshint homepage provides an online linter, which allows you to enter your javascript code on the left and provides an output on the right, including metrics, warnings, and
errors.
... after the packages have finished installing, try loading up a javascript file: you'll see any issues highlighted with green (for warnings) and red (for
errors) circles next to the line numbers, and a separate panel at the bottom provides line numbers,
error messages, and sometimes suggested values or other fixes.
...And 12 more matches
Sqlite.jsm
openconnection(options) returns a promise that resolves to an opened connection instance or is rejected if an
error occurred while opening the database.
...} catch (
error) { // the connection could not be opened.
...
error is an
error describing what went wrong.
...And 12 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
*/ /* nspr headers */ #include <prthread.h> #include <plgetopt.h> #include <pr
error.h> #include <prinit.h> #include <prlog.h> #include <prtypes.h> #include <plstr.h> /* nss headers */ #include <keyhi.h> #include <pk11priv.h> /* our samples utilities */ #include "util.h" /* constants */ #define blocksize 32 #define modblocksize 128 #define default_key_bits 1024 /* header file constants */ #define enckey_header "-----begin wrapped e...
...e, secupwdata *pwdata) { ck_mechanism_type mechanism; secoidtag algtag; pk11rsagenparams rsaparams; void *params; seckeyprivatekey *privkey = null; secstatus rv; unsigned char randbuf[blocksize + 1]; rv = generaterandom(randbuf, blocksize); if (rv != secsuccess) { fprintf(stderr, "
error while generating the random numbers : %s\n", port_
errortostring(rv)); goto cleanup; } pk11_randomupdate(randbuf, blocksize); switch (keytype) { case rsakey: rsaparams.keysizeinbits = size; rsaparams.pe = publicexponent; mechanism = ckm_rsa_pkcs_key_pair_gen; algtag ...
...getsignaturealgorithmoidtag(privkey->keytype, hashalgtag); if (algid == sec_oid_unknown) { pr_fprintf(pr_stderr, "unknown key or hash type for issuer.\n"); goto cleanup; } rv = secoid_setalgorithmid(arena, &cert->signature, algid, 0); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not set signature algorithm id.\n%s\n", port_
errortostring(rv)); goto cleanup; } /* we only deal with cert v3 here */ *(cert->version.data) = 2; cert->version.len = 1; der.len = 0; der.data = null; dummy = sec_asn1encodeitem (arena, &der, cert, sec_asn1_get(cert_certificatetemplate)); if (!dummy) { pr_fprintf(pr_stderr, "could not encode certificate.\n"); ...
...And 12 more matches
Debugger.Script - Firefox Developer Tools
for example: function h() { var i = function() {}; // display name: h/i f(function () {}); // display name: h/< } var s = f(function () {}); // display name: s< if the instance refers to webassembly code, throw a type
error.
... if the instance refers to webassembly code, throw a type
error.
... if the instance refers to webassembly code, throw a type
error.
...And 12 more matches
Debugger - Firefox Developer Tools
if the uncaught exception hook itself throws an exception,uncaught-hook-exception, spidermonkey throws a new
error object,confess-to-debuggee-exception, to the debuggee whose message blames the debugger, and includes textual descriptions ofuncaught-hook-exception and the originaldebugger-exception.
... assigning anything other than a callable value or null to this property throws a type
error exception.
...for example, an uncaught exception hook may have access to browser-level features like the alert function, which this api’s implementation does not, making it possible to present debugger
errors to the developer in a way suited to the context.) debugger handler functions each debugger instance inherits accessor properties with which you can store handler functions for spidermonkey to call when given events occur in debuggee code.
...And 12 more matches
DirectoryEntrySync - Web APIs
if you try to create a directory using a full path that includes parent directories that do not exist yet, you get an
error.
... object literal condition result create: true exclusive: true path already exists an
error is thrown.
... create: true exclusive: false path doesn't exist and no other
error occurs a file is created.
...And 12 more matches
WebGL best practices - Web APIs
general topics address and eliminate webgl
errors your application should run without generating any webgl
errors (as returned by get
error).
... every webgl
error is reported in the web console as a javascript warning with a descriptive message.
... after too many
errors (32 in firefox), webgl stops generating descriptive messages, which really hinders debugging.
...And 12 more matches
Comparing Reflect and Object methods - JavaScript
returns a type
error if the property was not successfully defined on the object.
...returns a type
error if any properties were not successfully defined on the object.
...throws a type
error if the target was not an object.
...And 12 more matches
LiveConnect Overview - Archive of obsolete content
netscape.javascript.jsexception allows java code to handle javascript
errors.
...this allows your java code to handle
errors in javascript code execution which appear in java as exceptions of type jsexception.
...note: a more realistic example would place the call to getmember inside a try...catch statement to handle
errors of type jsexception.
...And 11 more matches
Eclipse CDT
the benefit of building from inside eclipse is that build
errors will appear in the problems tab at the bottom of the window, and from there you can double click on the build
error and it will take you straight to the source file and line where the problem occurred.
...it also used to be necessary to add the following two lines to your mozconfig to make the compiler output
errors all on a single line, but that may not be needed anymore: export cflags="-fmessage-length=0" export cppflags="-fmessage-length=0" debugging to create a debug configuration, open the project properties window, and select "run/debug settings" on the left.
...this is responsible for most of the parse
errors in the source files displayed in eclipse.
...And 11 more matches
NSS API Guidelines
the library supports base-64 encoding/decoding, reader-writer locks, the secitem data type, der encoding/decoding,
error types and numbers, oid handling, and secure random number generation.
...
error handling nss 3.0 introduces the concept of an
error stack.
... when something goes wrong, the call stack unwinds, with routines returning an
error indication.
...And 11 more matches
Enc Dec MAC Output Public Key as CSR
#define ns_certreq_header "-----begin new certificate request-----" #define ns_certreq_trailer "-----end new certificate request-----" typedef enum { gen_csr, encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6 } headertype; /* this is conditionalized because port_
errortostring was introduced with nss 3.13.
... * though pr_
errortostring was available, support for it in nss wasn't.
... */ #ifndef port_
errortostring #ifndef sec_
error_base #define sec_
error_base (-0x2000) #define port_
errortostring(err) pr_
errortostring((err), pr_language_i_default) #endif #endif /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -s -r -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'g' for generating rsa keypair for wrapping\n\n", "g"); fprintf(stderr, "%-20s specify 'e' for encrypt operation\n\n", "e"); fprintf(stderr, "%-20s specify 'd' for decrypt operation\n\n", "d"); ...
...And 11 more matches
nsIEffectiveTLDService
exceptions thrown ns_
error_invalid_arg this exception is thrown if the hostname in auri is empty.
... ns_
error_insufficient_domain_levels this exception is thrown if there were insufficient subdomain levels in the hostname to satisfy the requested aadditionalparts value.
... ns_
error_host_is_ip_address this exception is thrown if auri is a numeric ipv4 or ipv6 address.
...And 11 more matches
FileSystemDirectoryEntry.removeRecursively() - Web APIs
syntax filesystemdirectoryentry.removerecursively(successcallback[,
errorcallback]); parameters successcallback a function to call once the directory removal process has completed.
...
errorcallback optional a function to be called if an
error occurs while attempting to remove the directory subtree.
... receives a file
error describing the
error which occurred as input.
...And 11 more matches
RTCPeerConnection.setRemoteDescription() - Web APIs
exceptions the following exceptions are reported to the rejection handler for the promise returned by setremotedescription(): invalidaccess
error the content of the description is invalid.
... invalidstate
error the rtcpeerconnection is closed, or it's in a state which isn't compatible with the specified description's type.
... operation
error any
errors that occur which don't match the others specifeid here are reported as operation
error.
...And 11 more matches
Sensor APIs - Web APIs
checking for thrown
errors when instantiating a sensor object.
... listening for
errors thrown during its use.
... handling the
errors gracefully so that the user experience is enhanced rather than degraded.
...And 11 more matches
Handling common HTML and CSS problems - Learn web development
let's go forth and look at how we can reduce cross browser
errors that result from html/css.
... basically, it is a matter of checking whether your html and css code is well formed and doesn't contain any syntax
errors.
...one service that can do this is the w3c markup validation service, which allows you to point to your code, and returns a list of
errors: css has a similar story — you need to check that your property names are spelled correctly, property values are spelled correctly and are valid for the properties they are used on, you are not missing any curly braces, and so on.
...And 10 more matches
NSS_3.12_release_notes.html
kcs11t.h for details): ckk: keys ckk_camellia ckm: mechanisms ckm_sha224_rsa_pkcs ckm_sha224_rsa_pkcs_pss ckm_sha224 ckm_sha224_hmac ckm_sha224_hmac_general ckm_sha224_key_derivation ckm_camellia_key_gen ckm_camellia_ecb ckm_camellia_cbc ckm_camellia_mac ckm_camellia_mac_general ckm_camellia_cbc_pad ckm_camellia_ecb_encrypt_data ckm_camellia_cbc_encrypt_data ckg: mfgs ckg_mgf1_sha224 new
error codes (see secerr.h): sec_
error_not_initialized sec_
error_token_not_logged_in sec_
error_ocsp_responder_cert_invalid sec_
error_ocsp_bad_signature sec_
error_out_of_search_limits sec_
error_invalid_policy_mapping sec_
error_policy_validation_failed sec_
error_unknown_aia_location_type sec_
error_bad_http_response sec_
error_bad_ldap_response sec_
error_failed_to_encode_data sec_
error_bad_info_access_loca...
...tion sec_
error_libpkix_internal new mechanism flags (see secmod.h) public_mech_aes_flag public_mech_sha256_flag public_mech_sha512_flag public_mech_camellia_flag new oids (see secoidt.h) new ec signature oids sec_oid_ansix962_ecdsa_signature_recommended_digest sec_oid_ansix962_ecdsa_signature_specified_digest sec_oid_ansix962_ecdsa_sha224_signature sec_oid_ansix962_ecdsa_sha256_signature sec_oid_ansix962_ecdsa_sha384_signature sec_oid_ansix962_ecdsa_sha512_signature more id-ce and id-pe oids from rfc 3280 sec_oid_x509_hold_instruction_code sec_oid_x509_delta_crl_indicator sec_oid_x509_issuing_distribution_point sec_oid_x509_cert_issuer sec_oid_x509_freshest_crl sec_oid_x509_inhibit_any_policy sec_oid_x509_subject_info_access camellia oids (rfc3657) sec_oid_camellia_128_cbc sec_oid_ca...
... tls session ticket extension (off by default) see ssl_enable_session_tickets in ssl.h new ssl
error codes (see sslerr.h) ssl_
error_unsupported_extension_alert ssl_
error_certificate_unobtainable_alert ssl_
error_unrecognized_name_alert ssl_
error_bad_cert_status_response_alert ssl_
error_bad_cert_hash_value_alert ssl_
error_rx_unexpected_new_session_ticket ssl_
error_rx_malformed_new_session_ticket new tls cipher suites (see sslproto.h): tls_rsa_with_camellia_128_cbc_sha tls_dhe_dss_with_camellia...
...And 10 more matches
nsISmsRequestManager
.createinstance(components.interfaces.nsismsrequestmanager); method overview long addrequest(in nsidommozsmsrequest arequest); long createrequest(in nsidommozsmsmanager amanager, out nsidommozsmsrequest arequest); void notifycreatemessagelist(in long arequestid, in long alistid, in nsidommozsmsmessage amessage); void notifygetsmsfailed(in long arequestid, in long a
error); void notifygotnextmessage(in long arequestid, in nsidommozsmsmessage amessage); void notifygotsms(in long arequestid, in nsidommozsmsmessage amessage); void notifymarkedmessageread(in long arequestid, in bool aread); void notifymarkmessagereadfailed(in long arequestid, in long a
error); void notifynomessageinlist(in long arequestid); void notifyreadmessagelistfailed(in long arequesti...
...d, in long a
error); void notifysmsdeleted(in long arequestid, in bool adeleted); void notifysmsdeletefailed(in long arequestid, in long a
error); void notifysmssendfailed(in long arequestid, in long a
error); void notifysmssent(in long arequestid, in nsidommozsmsmessage amessage); constants all sms related
errors that could apply to smsrequest objects.
... constant value description success_no_
error 0 no_signal_
error 1 not_found_
error 2 unknown_
error 3 internal_
error 4 methods addrequest() track an already existing request object.
...And 10 more matches
View Source - Firefox Developer Tools
if the number is higher than the lines in a file, you receive an
error message.
... syntax highlighting (toggle) applies syntax highlighting to the code.when syntax highlighting is on, view source also highlights parsing
errors in red.
... hovering your mouse over
errors displays a tooltip explaining the
error.
...And 10 more matches
Console messages - Firefox Developer Tools
the following icons may be used: informational message warning
error blocked; for network messages in addition, a disclosure triangle indicates that further information is available; clicking it displays or collapses that information.
... number of occurrences if a line that generates a warning or
error is executed more than once, it is only logged once and this counter appears to indicate how many times it was encountered.
... js javascript
errors contain a "learn more" link that takes you to the javascript
error reference containing additional advice for fixing issues: source maps the web console understands source maps.
...And 10 more matches
Using Fetch - Web APIs
the fetch specification differs from jquery.ajax() in three main ways: the promise returned from fetch() won’t reject on http
error status even if the response is an http 404 or 500.
... mode: 'cors', // no-cors, *cors, same-origin cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached credentials: 'same-origin', // include, *same-origin, omit headers: { 'content-type': 'application/json' // 'content-type': 'application/x-www-form-urlencoded', }, redirect: 'follow', // manual, *follow,
error referrerpolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url body: json.stringify(data) // body data type must match "content-type" header }); return response.json(); // parses json response into native javascript objects } postdata('https://example.com/answer', { ...
... const data = { username: 'example' }; fetch('https://example.com/profile', { method: 'post', // or 'put' headers: { 'content-type': 'application/json', }, body: json.stringify(data), }) .then(response => response.json()) .then(data => { console.log('success:', data); }) .catch((
error) => { console.
error('
error:',
error); }); uploading a file files can be uploaded using an html <input type="file" /> input element, formdata() and fetch().
...And 10 more matches
FileSystemDirectoryEntry.getDirectory() - Web APIs
syntax filesystemdirectoryentry.getdirectory([path][, options][, successcallback][,
errorcallback]); parameters path optional a usvstring representing an absolute path or a path relative to the directory on which the method is called, describing which directory entry to return.
... options optional an object based on the filesystemflags dictionary, which allows you to specify whether or not to create the entry if it's missing and if it's an
error if the file already exists.
...
errorcallback optional a method to be called if an
error occurs.
...And 10 more matches
FileSystemDirectoryEntry.getFile() - Web APIs
syntax filesystemdirectoryentry.getfile([path][, options][, successcallback][,
errorcallback]); parameters path optional a usvstring specifying the path, relative to the directory on which the method is called, describing which file's entry to return.
... options optional an object based on the filesystemflags dictionary, which allows you to specify whether or not to create the entry if it's missing and if it's an
error if the file already exists.
...
errorcallback optional a method to be called if an
error occurs.
...And 10 more matches
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
// adapted from the patch for moztcpsocket
error reporting (bug 861196).
... const {cc,ci} = require("chrome"); function createtcp
errorfromfailedxhr(xhr) { let status = xhr.channel.queryinterface(ci.nsirequest).status; let errtype; if ((status & 0xff0000) === 0x5a0000) { // security module const nsinss
errorsservice = ci.nsinss
errorsservice; let nss
errorsservice = cc['@mozilla.org/nss_
errors_service;1'].getservice(nsinss
errorsservice); let
errorclass; // get
errorclass will throw a generic ns_
error_failure if the
error code is // somehow not in the set of covered
errors.
... try {
errorclass = nss
errorsservice.get
errorclass(status); } catch (ex) { //catching security protocol exception
errorclass = 'securityprotocol'; } if (
errorclass == nsinss
errorsservice.
error_class_bad_cert) { errtype = 'securitycertificate'; } else { errtype = 'securityprotocol'; } // nss_sec
errors (happen below the base value because of negative vals) if ((status & 0xffff) < math.abs(nsinss
errorsservice.nss_sec_
error_base)) { // the bases are actually negative, so in our positive numeric space, we // need to subtract the base off our value.
...And 10 more matches
Grammar and types - JavaScript
(spaces, tabs, and newline characters are considered whitespace.) comments the syntax of comments is the same as in c++ and in many other languages: // a one line comment /* this is a longer, * multi-line comment */ /* you can't, however, /* nest comments */ syntax
error */ comments behave like whitespace, and are discarded during script execution.
... an attempt to access an undeclared variable results in a reference
error exception being thrown: var a; console.log('the value of a is ' + a); // the value of a is undefined console.log('the value of b is ' + b); // the value of b is undefined var b; // this one may puzzle you until you read 'variable hoisting' below console.log('the value of c is ' + c); // uncaught reference
error: c is not defined let x; console.log('the value of x is ' + x); // the value of x i...
...s undefined console.log('the value of y is ' + y); // uncaught reference
error: y is not defined let y; you can use undefined to determine whether a variable has a value.
...And 10 more matches
Exception logging in JavaScript - Archive of obsolete content
in versions of firefox prior to firefox 3, all javascript exceptions were always logged into the
error console if they remained unhandled at the time execution returned back into c++ code.
...this had the unintended consequence of logging "expected"
errors at length into the console.
...exception reporting in firefox 3 firefox 3 improves reporting of unhandled exceptions by establishing a set of rules that determines whether or not an exception is worth reporting: any methods on interfaces annotated with the [function] attribute in idl (see, for example, nsidomeventlistener) that throw exceptions always report those exceptions into the
error console.
...And 9 more matches
Starting WebLock
you can then use the service manager to add the component to the category: nsresult rv; nscomptr<nsiservicemanager> servman = do_queryinterface((nsisupports*)acompmgr, &rv); if (ns_failed(rv)) return rv; do_queryinterface the previous code uses the special nscomptr function do_queryinterface that lets you queryinterface without having to worry about reference counting,
error handling, and other overhead.
...assuming there weren't any unexpected
errors, the variable catman holds the nsicategorymanager interface pointer, which you can use to add the component as a startup observer by calling a method on the nsicategorymanager.
... * ns_
error_failure if there are no more elements * to enumerate.
...And 9 more matches
nsIAnnotationService
throws an
error if the annotation does not exist.
...throws an
error if the annotation does not exist.
...throws an
error if the annotation does not exist.
...And 9 more matches
Troubleshooting XPCOM components registration
there are several common reasons that registration can fail: a component that is a binary (shared library) fails to load a javascript component has parsing
errors the shared library loaded correctly, but registration was not successful did registration succeed?
...you can be certain that a component has failed to register by going to the
error console and evaluating components.classes["contract-id"].name where contract-id is your contract id.
... if the response is your contract id instead of an
error, the component was successfully registered and this is the wrong page.
...And 9 more matches
Streams - Plugins
the browser can create a stream for several different types of data: for the file specified in the data attribute of the object element or the src attribute of the embed element for a data file for a full-page instance the npp_newstream method has the following syntax: np
error npp_newstream(npp instance, npmimetype type, npstream *stream, npbool seekable, uint16* stype); the instance parameter refers to the plug-in instance receiving the stream; the type parameter represents the stream's mime type.
... np
error npp_destroystream(npp instance, npstream *stream, np
error reason); the instance parameter is the current plug-in instance; the stream parameter specifies the stream to be deleted.
... npres_network_err: the stream failed because of problems with the network, disk i/o
error, lack of memory, or some other problem.
...And 9 more matches
IDBTransaction - Web APIs
this causes an
error on the request, which can bubble up to an
error on the transaction, which aborts the transaction.
... this can be prevented by using preventdefault() on the
error event on the request.
... an uncaught exception in the request's success/
error handler.
...And 9 more matches
Capabilities, constraints, and settings - Web APIs
figuring this out has often been difficult, and has usually involved looking at some combination of which user agent (or browser) you're running on, which version it is, looking to see if certain objects exist, trying to see whether various things work or not and determining what
errors occur, and so forth.
... let supports = navigator.mediadevices.getsupportedconstraints(); if (!supports["width"] || !supports["height"] || !supports["framerate"] || !supports["facingmode"]) { // we're missing needed properties, so handle that
error.
...ts the first and most common way to use constraints is to specify them when you call getusermedia(): navigator.mediadevices.getusermedia({ video: { width: { min: 640, ideal: 1920 }, height: { min: 400, ideal: 1080 }, aspectratio: { ideal: 1.7777777778 } }, audio: { samplesize: 16, channelcount: 2 } }).then(stream => { videoelement.srcobject = stream; }).catch(handle
error); in this example, constraints are applied at getusermedia() time, asking for an ideal set of options with fallbacks for the video.
...And 9 more matches
PaymentResponse.retry() - Web APIs
the paymentresponse interface's retry() method makes it possible to ask the user to retry a payment after an
error occurs during processing.
... syntax retrypromise = paymentrequest.retry(
errorfields); parameters
errorfields a paymentvalidation
errors object, with the following properties:
error optional a general description of a payment
error from which the user may attempt to recover by retrying the payment, possibly after correcting mistakes in the payment information.
...
error can be provided all by itself to provide only a generic
error message, or in concert with the other properties to serve as an overview while other properties' values gude the user to
errors in specific fields in the payment form.
...And 9 more matches
WebGL constants - Web APIs
errors constants returned from webglrenderingcontext.get
error().
... constant name value description no_
error 0 returned from get
error.
... invalid_enum 0x0500 returned from get
error.
...And 9 more matches
Signaling and video calling - Web APIs
would be weird."); return; } targetusername = clickedusername; createpeerconnection(); navigator.mediadevices.getusermedia(mediaconstraints) .then(function(localstream) { document.getelementbyid("local_video").srcobject = localstream; localstream.gettracks().foreach(track => mypeerconnection.addtrack(track, localstream)); }) .catch(handlegetusermedia
error); } } this begins with a basic sanity check: is the user already connected?
... if an
error occurs while trying to get the local media stream, our catch clause calls handlegetusermedia
error(), which displays an appropriate
error to the user as required.
... handling getusermedia()
errors if the promise returned by getusermedia() concludes in a failure, our handlegetusermedia
error() function performs.
...And 9 more matches
passwords - Archive of obsolete content
so: if a web server at http://www.example.com requested authentication with a response code like this: http/1.0 401 authorization required server: apache/1.3.27 www-authenticate: basic realm="exampleco login" the corresponding values for the credential (excluding username and password) should be: url: "http://www.example.com" realm: "exampleco login" oncomplete and on
error this api is explicitly asynchronous, so all its functions take two callback functions as additional options: oncomplete and on
error.
... oncomplete is called when the operation has completed successfully and on
error is called when the function encounters an
error.
... for all functions, on
error is optional.
...And 8 more matches
Making asynchronous programming easier with async and await - Learn web development
rewriting promise code with async/await let's look back at a simple fetch example that we saw in the previous article: fetch('coffee.jpg') .then(response => { if (!response.ok) { throw new
error(`http
error!
....appendchild(image); }) .catch(e => { console.log('there has been a problem with your fetch operation: ' + e.message); }); by now, you should have a reasonable understanding of promises and how they work, but let's convert this to use async/await to see how much simpler it makes things: async function myfetch() { let response = await fetch('coffee.jpg'); if (!response.ok) { throw new
error(`http
error!
... since an async keyword turns a function into a promise, you could refactor your code to use a hybrid approach of promises and await, bringing the second half of the function out into a new block to make it more flexible: async function myfetch() { let response = await fetch('coffee.jpg'); if (!response.ok) { throw new
error(`http
error!
...And 8 more matches
Promise
once you have a reference to a promise, you can call its then() method to execute an action when the value becomes available, or when an
error occurs.
... rejected, if an
error prevented the final value from being determined.
...this may be any value, including undefined, though it is generally an
error object, like in exception handling.
...And 8 more matches
RTCPeerConnection - Web APIs
such an event is sent when an identity assertion is generated, via getidentityassertion() or during the creation of an offer or an answer.onidpassertion
error the rtcpeerconnection.onidpassertion
error event handler is a property containing the code to execute whent the idpassertion
error event, of type rtcidentity
errorevent, is received by this rtcpeerconnection.
... such an event is sent when the associated identity provider (idp) encounters an
error while generating an identity assertion.onidpvalidation
error the rtcpeerconnection.onidpvalidation
error event handler is a property containing the code to execute whent the idpvalidation
error event, of type rtcidentity
errorevent, is received by this rtcpeerconnection.
... such an event is sent when the associated identity provider (idp) encounters an
error while validating an identity assertion.onnegotiationneeded the rtcpeerconnection interface's onnegotiationneeded property is an eventlistener which specifies a function which is called to handle the negotiationneeded event when it occurs on an rtcpeerconnection instance.
...And 8 more matches
Promise - JavaScript
a pending promise can either be fulfilled with a value, or rejected with a reason (
error).
...sometimes there is no choice, because an
error must be handled immediately.
... (see throw -999 in the example, below, for a technique to handle the consequences.) on the other hand, in the absence of an immediate need, it is simpler to leave out
error handling until a final .catch() statement.
...And 8 more matches
let - JavaScript
redeclarations redeclaring the same variable within the same function or block scope raises a syntax
error.
... if (x) { let foo; let foo; // syntax
error thrown.
... } you may encounter
errors in switch statements because there is only one block.
...And 8 more matches
Modularization techniques - Archive of obsolete content
const nsiid &aiid, void **aresult); ns_imethod_(void) lockfactory(prbool alock); }; /* * nssample implementation */ nssample::nssample() { mrefcnt = 0; } nssample::~nssample() { assert(mrefcnt == 0); } ns_imethod nssample::queryinterface(const nsiid &aiid, void **aresult) { if (aresult == null) { return ns_
error_null_pointer; } // always null result, in case of failure *aresult = null; if (aiid.equals(kisupportsiid)) { *aresult = (void *) this; } else if (aiid.equals(kisampleiid)) { *aresult = (void *) this; } if (aresult != null) { return ns_
error_no_interface; } addref(); return ns_ok; } nsrefcount nssample::addref() { return ++mrefcnt; } nsrefcount nssample::rel...
... } return mrefcnt; } /* * nssamplefactory implementation */ nssamplefactory::nssamplefactory() { mrefcnt = 0; } nssamplefactory::~nssamplefactory() { assert(mrefcnt == 0); } ns_imethodimp nssamplefactory::queryinterface(const nsiid &aiid, void **aresult) { if (aresult == null) { return ns_
error_null_pointer; } // always null result, in case of failure *aresult = null; if (aiid.equals(kisupportsiid)) { *aresult = (void *) this; } else if (aiid.equals(kifactoryiid)) { *aresult = (void *) this; } if (*aresult == null) { return ns_
error_no_interface; } addref(); // increase reference count for caller return ns_ok; } ns_imethodimp(nsrefcount) nssamplefact...
... } return mrefcnt; } ns_imethodimp nssamplefactory::createinstance(nsisupports *aouter, const nsiid &aiid, void **aresult) { if (aresult == null) { return ns_
error_null_pointer; } *aresult = null; nsisupports inst = new nssample(); if (inst == null) { return ns_
error_out_of_memory; } nsresult res = inst->queryinterface(aiid, aresult); if (res != ns_ok) { // we didn't get the right interface, so clean up delete inst; } return res; } void nssamplefactory::lockfactory(prbool alock) { // not implemented in simplest case.
...And 7 more matches
Additional Install Features - Archive of obsolete content
if this file does not exist, an
error will occur during the installation.
...handling
errors you will likely want to handle
errors gracefully.
...you can use the getlast
error() function to determine whether an
error occured.
...And 7 more matches
Using IO Timeout And Interrupt On NT - Archive of obsolete content
due to a limitation of the present implementation of nspr io on nt, programs must follow the following guideline: if a thread calls an nspr io function on a file descriptor and the io function fails with <tt>pr_io_timeout_
error</tt> or <tt>pr_pending_interrupt_
error</tt>, the file descriptor must be closed before the thread exits.
...a thread calling an io function is blocked until the io operation finishes, either due to a successful io completion or an
error.
... if the io operation cannot complete before the specified timeout, the io function returns with <tt>pr_io_timeout_
error</tt>.
...And 7 more matches
CSS and JavaScript accessibility best practices - Learn web development
here you'll see a simple form; when you try to submit the form with one or both fields left empty, the submit fails, and an
error message box appears to tell you what is wrong.
...the client-side validation is still really useful for reporting
errors — users can know about mistakes they make instantly, rather than having to wait for a round trip to the server and a page reload.
...re unambiguously linked to their inputs, so screen readers can read them out alongside: <label for="name">enter your name:</label> <input type="text" name="name" id="name"> we only do the validation when the form is submitted — this is so that we don't update the ui too often and potentially confuse screen reader (and possibly other) users: form.onsubmit = validate; function validate(e) {
errorlist.innerhtml = ''; for(let i = 0; i < formitems.length; i++) { const testitem = formitems[i]; if(testitem.input.value === '') {
errorfield.style.left = '360px'; createlink(testitem); } } if(
errorlist.innerhtml !== '') { e.preventdefault(); } } note: in this example, we are hiding and showing the
error message box using absolute positioning rather than anoth...
...And 7 more matches
AddonManager
if an
error occurred (such as an add-on not being found), null is passed back instead.
... addoninstall
errors constant description
error_network_failure a network
error occurred.
...
error_incorrect_hash the downloaded file did not match the expected hash.
...And 7 more matches
Python binding for NSS
error codes are never returned from methods/functions.
...any
error reported by nss/nspr is converted into a python exception and raised.
... the exact
error code,
error description, and often contextual
error information will be present in the exception object.
...And 7 more matches
NSS_3.12.3_release_notes.html
new in nss 3.12.3 changes in behavior: in the development of nss 3.12.3, it became necessary to change some old library behaviors due to the discovery of certain vulnerabilities in the old behaviors, and to correct some
errors that had limited nss's ability to interoperate with cryptographic hardware and software from other sources.
... nss_strict_nofork string ("1", "disabled", or any other non-empty value) it is an
error to try to use a pkcs#11 crypto module in a process before it has been initialized in that process, even if the module was initialized in the parent process.
... beginning in nss 3.12.3, softoken will detect this
error.
...And 7 more matches
Shell global objects
options is an optional object that may have these properties: isrunonce use the isrunonce compiler option (default: false) noscriptrval use the no-script-rval compiler option (default: false) filename filename for
error messages and debug info linenumber starting line number for
error messages and debug info columnnumber starting column number for
error messages and debug info global global in which to execute the code newcontext if true, create and use a new cx (default: false) catchtermination if true, catch termination (failure without an exception value, as for slow scripts or out-of-memo...
... throw
error() throw an
error from js_report
error.
...if present, options may have properties saying how the code should be compiled: noscriptrval use the no-script-rval compiler option (default: false) filename filename for
error messages and debug info linenumber starting line number for
error messages and debug info columnnumber starting column number for
error messages and debug info element if present with value v, convert v to an object o and mark the source as being attached to the dom element o.
...And 7 more matches
mozIStorageService
if this method throws ns_
error_file_corrupted, it's recommended that you call mozistorageservice.backupdatabasefile() to back up the database so that user data is not lost (although we have no way of recovering this data yet).
...if you use this method to open a database containing virtual tables, it will think the database is corrupted and throw ns_
error_file_corrupted.
...exceptions thrown ns_
error_failure an
error occurred attempting to open the database.
...And 7 more matches
nsIHttpServer
* * @param port * the port upon which listening should happen, or -1 if no specific port is * desired * @throws ns_
error_already_initialized * if this server is already started * @throws ns_
error_not_available * if the server is not started and cannot be started on the desired port * (perhaps because the port is already in use or because the process does * not have privileges to do so) * @note * behavior is undefined if this method is called after stop() has been * called on this...
... * * @param callback * an asynchronous callback used to notify the user when this server is * stopped and all pending requests have been fully served * @throws ns_
error_null_pointer * if callback is null * @throws ns_
error_unexpected * if this server is not running */ void stop(in nsihttpserverstoppedcallback callback); /** * associates the local file represented by the string file with all requests * which match request.
...lly be canonicalized, since most browsers will do so * before sending otherwise-matching requests * @param handler * an object which will handle any requests for the given path, or null to * remove any existing handler; if while the server is running the handler * throws an exception while responding to a request, an http 500 response * will be returned * @throws ns_
error_invalid_arg * if path does not begin with a "/" */ void registerpathhandler(in string path, in nsihttprequesthandler handler); /** * registers a custom prefix handler.
...And 7 more matches
IDBRequest - Web APIs
when the state is set to done, every request returns a result and an
error, and an event is fired on the request.
... when the state is still pending, any attempt to access the result or
error raises an invalidstate
error exception.
...if an
error occurs while performing the operation, the exception is made available through the result property and an
error event is fired (idbrequest.on
error).
...And 7 more matches
LocalFileSystem - Web APIs
so to request storage, you need to do something like the following: var requestedbytes = 1024*1024*10; // 10mb navigator.webkitpersistentstorage.requestquota ( requestedbytes, function(grantedbytes) { window.requestfilesystem(persistent, grantedbytes, oninitfs,
errorhandler); }, function(e) { console.log('
error', e); } ); your user must grant your app permission to store data locally before your app can use persistent storage.
... //taking care of the browser-specific prefix window.requestfilesystem = window.requestfilesystem || window.webkitrequestfilesystem; // the first parameter defines the type of storage: persistent or temporary // next, set the size of space needed (in bytes) // initfs is the success callback // and the last one is the
error callback // for denial of access and other
errors.
... window.requestfilesystem(window.persistent, 1024*1024,oninitfs,
errorhandler); method overview void requestfilesystem (in unsigned short type, in unsigned long long size, in filesystemcallback successcallback, in optional
errorcallback
errorcallback); void resolvelocalfilesystemurl (in domstring url, in entrycallback successcallback, in optional
errorcallback
errorcallback); constants constant value description temporary 0 transient storage that can be be removed by the browser at its discretion.
...And 7 more matches
MediaRecorder.start() - Web APIs
note: if the browser is unable to start recording or continue recording, it will raise a dom
error event, followed by a mediarecorder.dataavailable event containing the blob it has gathered, followed by the mediarecorder.stop event.
... exceptions
errors that can be detected immediately are thrown as dom exceptions.
... all other
errors are reported through
error events sent to the mediarecorder object.
...And 7 more matches
PaymentRequest.show() - Web APIs
once one paymentrequest's show() method has been called, any other call to show() will by rejected with an abort
error until the returned promise has been concluded, either by being fulfilled with a paymentresponse indicating the results of the payment request, or by being rejected with an
error.
... exceptions abort
error the returned promise rejects with an abort
error if the user agent is already showing a payment panel.
... the promise is also rejected with abort
error if the user cancels the payment request.
...And 7 more matches
Web APIs
a angle_instanced_arrays abortcontroller abortsignal absoluteorientationsensor abstractrange abstractworker accelerometer address
errors aescbcparams aesctrparams aesgcmparams aeskeygenparams ambientlightsensor analysernode animation animationeffect animationevent animationplaybackevent animationtimeline arraybufferview attr audiobuffer audiobuffersourcenode audioconfiguration audiocontext audiocontextlatencycategory audiocontextoptions audiodestinationnode audiolistener audionode audionodeoptions audioparam audioparamdescr...
...e client clients clipboard clipboardevent clipboarditem closeevent comment compositionevent constantsourcenode constrainboolean constraindomstring constraindouble constrainulong contentindex contentindexevent convolvernode countqueuingstrategy crashreportbody credential credentialscontainer crypto cryptokey cryptokeypair customelementregistry customevent d domconfiguration dom
error domexception domhighrestimestamp domimplementation domimplementationlist domlocator dommatrix dommatrixreadonly domobject domparser dompoint dompointinit dompointreadonly domquad domrect domrectreadonly domstring domstringlist domstringmap domtimestamp domtokenlist domuserdata datatransfer datatransferitem datatransferitemlist dedicatedworkerglobalscope delaynode deprecationreportbo...
...dynamicscompressornode e ext_blend_minmax ext_color_buffer_float ext_color_buffer_half_float ext_disjoint_timer_query ext_float_blend ext_frag_depth ext_srgb ext_shader_texture_lod ext_texture_compression_bptc ext_texture_compression_rgtc ext_texture_filter_anisotropic eckeygenparams eckeyimportparams ecdhkeyderiveparams ecdsaparams effecttiming element elementcssinlinestyle elementtraversal
errorevent event eventlistener eventsource eventtarget extendableevent extendablemessageevent f featurepolicy federatedcredential fetchevent file fileentrysync file
error fileexception filelist filereader filereadersync filerequest filesystem filesystemdirectoryentry filesystemdirectoryreader filesystementry filesystementrysync filesystemfileentry filesystemflags filesystems...
...And 7 more matches
Cognitive accessibility - Accessibility
r advertisements; providing consistent web page layout and navigation; incorporating familiar elements, such as underlined links that are blue when not visited and purple when visited; dividing processes into logical, essential steps with progress indicators; making website authentication as easy as possible without compromising security; and making forms easy to complete, such as with clear
error messages and simple
error recovery.
... input assistance guidelines aim to reduce the likelihood that users, especially those with disabilities, make a mistake, and, if they do make a mistake, increase the likelihood that they see and comprehend the
error message and can successfully fix any
errors.
... convey automated
error detection users need to be alerted to the
error and informed of what is wrong.
...And 7 more matches
Promise.prototype.then() - JavaScript
if one or both arguments are omitted or are provided non-functions, then then will be missing the handler(s), but will not generate any
errors.
...if it is not a function, it is internally replaced with a "thrower" function (it throws an
error it received as argument).
... throws an
error, the promise returned by then gets rejected with the thrown
error as its value.
...And 7 more matches
Debugging a XULRunner Application - Archive of obsolete content
xulrunner.exe /path/to/application.ini -jsconsole by default the js console only shows
errors from web content.
... to show
errors in chrome javascript, the pref pref("javascript.options.showinconsole", true) must be set.
... to log js
errors to disk, set the environment variable xre_console_log to the path to the filename.
...And 6 more matches
Introduction to automated testing - Learn web development
to update npm, use the following command in your terminal: npm install npm@latest -g note: if the above command fails with permissions
errors, fixing npm permissions should sort you out.
...a reasonable set of basic functionalities to run on our project is as follows: html-tidy, css-lint, and js-hint to lint and report/fix common html/css/js
errors (see gulp-htmltidy, gulp-csslint, gulp-jshint).
...we first run htmltidy() on the source, which goes through and fixes
errors in our file.
...And 6 more matches
How to implement a custom autocomplete search component
'); const class_id = components.id('x753d830-ba1e-11e0-962b-0800200c9a66'); // ← change this const class_name = "basic autocomplete"; const contract_id = '@mozilla.org/autocomplete/search;1?name=basic-autocomplete'; /** * @constructor * * @implements {nsiautocompleteresult} * * @param {string} searchstring * @param {number} searchresult * @param {number} defaultindex * @param {string}
errordescription * @param {array.<string>} results * @param {array.<string>|null=} comments */ function providerautocompleteresult(searchstring, searchresult, defaultindex,
errordescription, results, comments) { this._searchstring = searchstring; this._searchresult = searchresult; this._defaultindex = defaultindex; this._
errordescription =
errordescription; this._results = results; thi...
...s._comments = comments; } providerautocompleteresult.prototype = { _searchstring: "", _searchresult: 0, _defaultindex: 0, _
errordescription: "", _results: [], _comments: [], /** * @return {string} the original search string */ get searchstring() { return this._searchstring; }, /** * @return {number} the result code of this result object, either: * result_ignored (invalid searchstring) * result_failure (failure) * result_nomatch (no matches found) * result_success (matches found) */ get searchresult() { return this._searchresult; }, /** * @return {number} the index of the default item that should be entered if * none is selected */ get defaultindex() { return this._defaultindex; }, /** * @retur...
...n {string} description of the cause of a search failure */ get
errordescription() { return this._
errordescription; }, /** * @return {number} the number of matches */ get matchcount() { return this._results.length; }, /** * @return {string} the value of the result at the given index */ getvalueat: function(index) { return this._results[index]; }, /** * @return {string} the comment of the result at the given index */ getcommentat: function(index) { if (this._comments) return this._comments[index]; else return ''; }, /** * @return {string} the style hint for the result at the given index */ getstyleat: function(index) { if (!this._comments || !this._comments[index]) return null; // not a category la...
...And 6 more matches
Extending a Protocol
vigator.echo() in your favorite editor, open dom/webidl/navigator.webidl at the end of the file, add: partial interface navigator { [throws] promise<domstring> echo(domstring astring); }; now we need to implement the echo() method in c++, so open up ./dom/base/navigator.h and let's add the method definition, so under public:: already_addrefed<promise> echo(const nsastring& astring,
errorresult& arv); we use nsastring& as the domstring comes in from js as utf-16.
... now let's implement the method in ./dom/base/navigator.cpp - we add a little bit of
error boilerplate stuff, as is customary: already_addrefed<promise> navigator::echo(const nsastring& astring,
errorresult& arv) { if (!mwindow || !mwindow->getdocshell()) { arv.throw(ns_
error_unexpected); return nullptr; } refptr<promise> echopromise = promise::create(mwindow->asglobal(), arv); if (ns_warn_if(arv.failed())) { return nullptr; } // message passing magic will happen here!
... if we now do ./mach build, it complains that "fatal
error: 'mozilla/dom/echochild.h' file not found".
...And 6 more matches
Assert.jsm
the assert.jsm javascript code module implements the commonjs unit testing specification version 1.1, which provides a basic, standardized interface for performing in-code logical assertions with optional, customizable
error reporting.
... let assert = new assert(reporterfunc); the new assert instance, assert, uses reporterfunc to report assertion results or throws an assertion
error when an assertion fails, as default behavior.
... undefined notstrictequal( actual, expected, message ); parameters actual test subject to be evaluated as not strictly equivalent to expected expected test reference to evaluate against actual message short explanation of the expected result throws() expected to throw an
error.
...And 6 more matches
NSS Sample Code Sample_3_Basic Encryption and MACing
sample code 3 /* nspr headers */ #include <prthread.h> #include <plgetopt.h> #include <pr
error.h> #include <prinit.h> #include <prlog.h> #include <prtypes.h> #include <plstr.h> /* nss headers */ #include <keyhi.h> #include <pk11priv.h> /* our samples utilities */ #include "util.h" #define buffersize 80 #define digestsize 16 #define ptext_mac_buffer_size 96 #define ciphersize 96 #define blocksize 32 #define cipher_header "-----begin cipher-----" #define cipher_trailer "-----end cipher-----" #define enckey_header "-----begin aeskey ckaid-----" #define enckey_trailer "-----end aeskey ckaid-----" #d...
...*/ /* nspr headers */ #include <prthread.h> #include <plgetopt.h> #include <pr
error.h> #include <prinit.h> #include <prlog.h> #include <prtypes.h> #include <plstr.h> /* * gather a cka_id */ secstatus gathercka_id(pk11symkey* key, secitem* buf) { secstatus rv = pk11_readrawattribute(pk11_typesymkey, key, cka_id, buf); if (rv != secsuccess) { pr_fprintf(pr_stderr, "pk11_readrawattribute returned (%d)\n", rv); pr_fprintf(pr_stderr, "could not read symkey ...
... "could not authenticate to token %s.\n", pk11_gettokenname(slot)); if (slot) { pk11_freeslot(slot); } return null; } } key = pk11_findfixedkey(slot, mechanism, keybuf, 0); if (!key) { pr_fprintf(pr_stderr, "pk11_findfixedkey failed (err %d)\n", pr_get
error()); pk11_freeslot(slot); return null; } return key; } /* * decrypt and verify mac */ secstatus decryptandverifymac( const char* outfilename, char *encryptedfilename, secitem *citem, secitem *macitem, pk11symkey* ek, pk11symkey* mk, secitem *ivitem, secitem *paditem) { secstatus rv; prfiledesc* infile; prfiledesc* outfile; unsi...
...And 6 more matches
nsILocalFile
exceptions thrown ns_
error_file_unrecognized_path indicates that relativefilepath incorrectly begins with a path separator character or otherwise contains invalid characters.
... exceptions thrown ns_
error_file_unrecognized_path indicates that relativefilepath incorrectly begins with a path separator character or otherwise contains invalid characters.
... exceptions thrown ns_
error_file_unrecognized_path indicates that filepath is not an absolute file path or that it contains characters that are invalid for the filesystem.
...And 6 more matches
nsIUpdate
errorcode long a numeric
error code that conveys additional information about the state of a failed update or failed certificate attribute check during an update check.
... ok (0) no
error.
... mem_
error (1) a memory
error occurred.
...And 6 more matches
Constants - Plugins
error codes code value description nperr_no_
error 0 no
errors occurred.
... nperr_generic_
error 1
error with no specific
error code occurred.
... nperr_invalid_instance_
error 2 invalid instance passed to the plug-in.
...And 6 more matches
Constraint validation API - Web APIs
lements listed below with a number of new properties and methods (elements that can have a form attribute that indicates their form owner): htmlbuttonelement htmlfieldsetelement htmlinputelement htmlobjectelement htmloutputelement htmlselectelement htmltextareaelement properties validity a read-only property that returns a validitystate object, whose properties represent validation
errors for the value of that element.
...this will be displayed in the ui if the element is the only form control with a validity problem; if a custom
error message is set using setcustomvalidity(), this will be shown.
... setcustomvalidity(message) sets a custom
error message string to be shown to the user upon submitting the form, explaining why the value is not valid — when a message is set, the validity state is set to invalid.
...And 6 more matches
MediaDevices.getDisplayMedia() - Web APIs
exceptions rejections of the returned promise are made by passing a domexception
error object to the promise's failure handler.
... possible
errors are: abort
error an
error or failure that doesn't match any of the other exceptions below occurred.
... invalidstate
error the call to getdisplaymedia() was not made from code running due to a user action, such as an event handler.
...And 6 more matches
Understandable - Accessibility
success criteria how to conform to the criteria practical resource 3.3.1
error identification (a) when a user is filling out a form or choosing between options, any
error that is detected should be clearly reported to the user, along with the form control that the
error relates to.
... it is advisable to implement client-side
error detection and handling, via html5 form validation features, and/or javascript, whatever is best for your situation.
... when an
error is detected, an intuitive
error message should be shown next to the form input that is at fault to help the user correct their inputs.
...And 6 more matches
Index - HTTP
for workers, non-compliant requests are treated as fatal network
errors by the user agent.
...when this policy is enabled, the promise returned by mediadevices.getusermedia() will reject with a notallowed
error.
...when this policy is enabled, the returned promise rejects with a type
error.
...And 6 more matches
Object.create() - JavaScript
if proto is neither of these a type
error is thrown.
...this is especially true when debugging, since common object-property converting/detecting utility functions may generate
errors, or simply lose information (especially if using silent
error-traps that ignore
errors).
...however, when attempting to actually use these objects, their differences quickly become apparent: > "oco is: " + oco // shows "oco is: [object object]" > "ocn is: " + ocn // throws
error: cannot convert object to primitive value testing just a few of the many most basic built-in functions shows the magnitude of the problem more clearly: > alert(oco) // shows [object object] > alert(ocn) // throws
error: cannot convert object to primitive value > oco.tostring() // shows [object object] > ocn.tostring() // throws
error: ocn.tostring is not a function > oco.valueof() // shows {...
...And 6 more matches
var - JavaScript
duplicate variable declarations using var will not trigger an
error, even in strict mode, and the variable will not lose its value, unless another assignment is performed.
... 'use strict'; function foo() { var x = 1; function bar() { var y = 2; console.log(x); // 1 (function `bar` closes over `x`) console.log(y); // 2 (`y` is in scope) } bar(); console.log(x); // 1 (`x` is in scope) console.log(y); // reference
error in strict mode, `y` is scoped to `bar` } foo(); variables declared using var are created before any code is executed in a process known as hoisting.
... 'use strict'; console.log(x); // undefined (note: not reference
error) console.log('still going...'); // still going...
...And 6 more matches
console - Archive of obsolete content
enables your add-on to log
error, warning or informational messages.
... console.
error(object[, object, ...]) logs the arguments to the console, preceded by "
error:" and the name of your add-on: console.
error("this is an
error message");
error: my-addon: this is an
error message console.exception(exception) logs the given exception instance as an
error, outputting information about the exception's stack traceback if one is available.
... try { dothing(); } catch (e) { console.exception(e); } function userexception(message) { this.message = message; this.name = "userexception"; } function dothing() { throw new userexception("thing could not be done!"); }
error: my-addon: an exception occurred.
...And 5 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
true javascript.options.showinconsole (present in firefox 3.5+) outputs javascript
errors to the
error console.
... true javascript.options.strict (present in firefox 3.5+) enforces strict
error output from javascript true table 1: preferences to set for developing extensions to make these changes, start your development profile, type about:config into firefox’s location bar and open the preferences window; find the preferences listed in table 1 and double-click on them to set them accordingly.
... if your extension isn’t working according to plan, first see if there’s an
error being displayed on the
errors panel of the
error console.
...And 5 more matches
Return Codes - Archive of obsolete content
bad_package_name -200 a problem occurred with the package name supplied to initinstall unexpected_
error -201 an unrecognized
error occurred.
... execution_
error -203 an
error occurred executing the script no_install_script -204 installation script was not signed no_certificate -205 extracted file is not signed or the file (and, therefore, its certificate) could not be found.
... apple_single_err -218 an
error occurred when unpacking a file in applesingle format.
...And 5 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
2 404 glossary, http
errors, infrastructure, navigation a 404 is a standard response code meaning that the server cannot find the requested resource.
... 3 502 502, bad gateway, glossary, http
errors, infrastructure, navigation an http
error code meaning "bad gateway".
...in javascript syntax
errors are a very common source of exceptions.
...And 5 more matches
NetUtil.jsm
createinstance(ci.nsistringinputstream); istream.setdata(test_data, test_data.length); netutil.asynccopy(istream, ostream, function(aresult) { if (!components.issuccesscode(aresult)) { // an
error occurred!
... if (!components.issuccesscode(aresult)) { // handle
error return; } // consume the input stream.
... }); remarks note: if you specify an nsichannel as the input source, and its notification callbacks have already been set, callers are responsible for implementing nsibadcertlistener and nsissl
errorlistener.
...And 5 more matches
Index
if you supply the log parameter, nss will continue chain validation after each
error .
...if any of these databases already exist in a specified directory, modutil returns an
error message.
... return codes o 0 - no
error o 1 - user cancelled o 2 - usage
error o 6 - nls init
error o 8 - certificate db open
error o 9 - key db open
error o 10 - file initialization
error o 11 - unicode conversion
error o 12 - temporary file creation
error o 13 - pkcs11 get slot
error o 14 - pkcs12 decoder start
error o 15 -
error read from import file o 16 - pkcs...
...And 5 more matches
Animated PNG graphics
error handling apng is designed to allow incremental display of frames before the entire image has been read.
... this implies that some
errors may not be detected until partway through the animation.
... it is strongly recommended that when any
error is encountered decoders should discard all subsequent frames, stop the animation, and revert to displaying the default image.
...And 5 more matches
Creating the Component Code
if that fails, return an out of memory
error code.
... ns_imethodimp samplefactory::createinstance(nsisupports *aouter, const nsiid & iid, void * *result) { if (!result) return ns_
error_invalid_arg; sample* sample = new sample(); if (!sample) return ns_
error_out_of_memory; nsresult rv = sample->queryinterface(iid, result); if (ns_failed(rv)) { *result = nsnull; delete sample; } return rv; } weblock1.cpp before any of the improvements and xpcom tools we describe in the following chapter are brought in, the source code for the weblock component that ...
...nt; public: sample(); virtual ~sample(); ns_imethod queryinterface(const nsiid &aiid, void **aresult); ns_imethod_(nsrefcnt) addref(void); ns_imethod_(nsrefcnt) release(void); }; sample::sample() { mrefcnt = 0; } sample::~sample() { } ns_imethodimp sample::queryinterface(const nsiid &aiid, void **aresult) { if (aresult == null) { return ns_
error_null_pointer; } *aresult = null; if (aiid.equals(kisupportsiid)) { *aresult = (void *) this; } if (*aresult == null) { return ns_
error_no_interface; } addref(); return ns_ok; } ns_imethodimp_(nsrefcnt) sample::addref() { return ++mrefcnt; } ns_imethodimp_(nsrefcnt) sample::release() { if (--mrefcnt == 0) { delete this; return 0; } return mrefcnt; } // ...
...And 5 more matches
mozIStorageConnection
it is the primary interface for interacting with a database, including creating prepared statements, executing sql, and examining database
errors.
... last
error long the last sqlite
error code that occurred.
... last
errorstring autf8string the english
error string reported by the sqlite library for the last sqlite operation.
...And 5 more matches
nsICrashReporter
exceptions thrown ns_
error_not_initialized if crash reporting is not initialized.
... exceptions thrown ns_
error_failure on get if no url is set.
... ns_
error_invalid_arg on set if a non-http(s) url is assigned.
...And 5 more matches
nsIDownloadManager
download_failed 2 the download failed due to
error.
... exceptions thrown ns_
error_failure the download is not in progress.
... exceptions thrown ns_
error_not_available the download is not in the database.
...And 5 more matches
nsIToolkitProfileService
this may throw an ns_
error_failure (0x80004005) when trying to get the current profile if it's unavailable or if permissions restrict access.
...exceptions thrown ns_
error_unexpected an unexpected
error condition occurred.
... ns_
error_file_not_directory one of the specified directory files is not actually a directory.
...And 5 more matches
Initialization and Destruction - Plugins
np
error np_initialize(void) { }; after the last plug-in instance is deleted, the browser calls np_shutdown, which releases the memory or resources allocated by np_initialize.
... np
error npp_new(npmimetype plugintype, npp instance, uint16 mode, int16 argc, char *argn[], char *argv[], npsaveddata *saved); the plugintype parameter represents the mime type of this instance of the plug-in.
... np
error npp_destroy(npp instance, npsaveddata **save); the instance parameter represents the plug-in instance to delete.
...And 5 more matches
FileSystemEntry.remove() - Web APIs
syntax filesystementry.remove(successcallback[,
errorcallback]); parameters successcallback a function which is called once the file has been successfully removed.
...
errorcallback optional an optional callback which is called if the attempt to remove the file fails.
...
errors file
error.invalid_modification_err the specified entry was the file system's root directory, or the specified entry is a directory which isn't empty.
...And 5 more matches
Using the Geolocation API - Web APIs
you can optionally provide a second callback function to be executed if an
error occurs.
...the
error callback function, which is optional just as it is for getcurrentposition(), can be called repeatedly.
... navigator.geolocation.clearwatch(watchid); fine tuning the response both getcurrentposition() and watchposition() accept a success callback, an optional
error callback, and an optional positionoptions object.
...And 5 more matches
IDBObjectStore.add() - Web APIs
if a record already exists in the object store with the key parameter as its key, then an
error constrain
error event is fired on the returned request object.
... exceptions this method may raise a domexception of one of the following types: exception description readonly
error the transaction associated with this operation is in read-only mode.
... transactioninactive
error this idbobjectstore's transaction is inactive.
...And 5 more matches
IDBObjectStore.createIndex() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description constraint
error occurs if an index with the same name already exists in the database.
... invalidaccess
error occurs if the provided key path is a sequence, and multientry is set to true in the objectparameters object.
... invalidstate
error occurs if either: the method was not called from a versionchange transaction mode callback, i.e.
...And 5 more matches
Using the Payment Request API - Web APIs
const checkoutbutton = document.getelementbyid('checkout-button'); if (window.paymentrequest) { let request = new paymentrequest(buildsupportedpaymentmethodnames(), buildshoppingcartdetails()); checkoutbutton.addeventlistener('click', function() { request.show().then(function(paymentresponse) { // handle successful payment }).catch(function(
error) { // handle cancelled or failed payment.
... = "loading..."; if (window.paymentrequest) { let request = new paymentrequest(buildsupportedpaymentmethodnames(), buildshoppingcartdetails()); request.canmakepayment().then(function(canmakeafastpayment) { if (canmakeafastpayment) { checkoutbutton.innertext = "fast checkout with w3c"; } else { checkoutbutton.innertext = "setup w3c checkout"; } }).catch(function(
error) { // the user may have turned off the querying functionality in their // privacy settings.
...let shouldcallpaymentrequest = true; let fallbacktolegacyonpaymentrequestfailure = false; (new paymentrequest(supportedpaymentmethods, {total: {label: 'stub', amount: {currency: 'usd', value: '0.01'}}}) .canmakepayment() .then(function(result) { shouldcallpaymentrequest = result; }).catch(function(
error) { console.log(
error); // the user may have turned off query ability in their privacy settings.
...And 5 more matches
ReadableStream.pipeTo() - Web APIs
the pipeto() method of the readablestream interface pipes the current readablestream to a given writablestream and returns a promise that fulfills when the piping process completes successfully, or rejects if any
errors were encountered.
...the method will return a fulfilled promise once this process completes, unless an
error is encountered while closing the destination in which case it will be rejected with that
error.
... preventabort: if this is set to true,
errors in the source readablestream will no longer abort the destination writablestream.
...And 5 more matches
Using the Screen Capture API - Web APIs
starting screen capture: async/await style async function startcapture(displaymediaoptions) { let capturestream = null; try { capturestream = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); } catch(err) { console.
error("
error: " + err); } return capturestream; } you can write this code either using an asynchronous function and the await operator, as shown above, or using the promise directly, as seen below.
... starting screen capture: promise style function startcapture(displaymediaoptions) { let capturestream = null; return navigator.mediadevices.getdisplaymedia(displaymediaoptions) .catch(err => { console.
error("
error:" + err); return null; }); } either way, the user agent responds by presenting a user interface that prompts the user to choose the screen area to share.
...ment.getelementbyid("stop"); // options for getdisplaymedia() var displaymediaoptions = { video: { cursor: "always" }, audio: false }; // set event listeners for the start and stop buttons startelem.addeventlistener("click", function(evt) { startcapture(); }, false); stopelem.addeventlistener("click", function(evt) { stopcapture(); }, false); logging content to make logging of
errors and other issues easy, this example overrides certain console methods to output their messages to the <pre> block whose id is log.
...And 5 more matches
Using writable streams - Web APIs
abort(reason) — a method that will be called if the app signals that it wishes to abruptly close the stream and put it in an
errored state.
...rue }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink
error:", err); } }, queuingstrategy); the write() method contains a promise including code that decodes each written chunk into a format that can be written to the ui.
... the abort() method simply prints an
error to the console if the stream is aborted.
...And 5 more matches
Using DTMF with WebRTC - Web APIs
if successful, the function gotstream() is called, otherwise we log the
error because calling has failed.
...that's handled by handlecallericeevent(): function handlecallericeevent(event) { if (event.candidate) { log("adding candidate to receiver: " + event.candidate.candidate); receiverpc.addicecandidate(new rtcicecandidate(event.candidate)) .catch(err => log("
error adding candidate to receiver: " + err)); } else { log("caller is out of candidates."); } } if the icecandidate event has a non-null candidate property, we create a new rtcicecandidate object from the event.candidate string and "transmit" it to the receiver by calling receiverpc.addicecandidate(), providing the new rtcicecandidate as its input.
... if addicecandidate() fails, the catch() clause outputs the
error to our log box.
...And 5 more matches
WindowOrWorkerGlobalScope.fetch() - Web APIs
the promise does not reject on http
errors — it only rejects on network
errors.
... you must use then handlers to check for http
errors.
... a fetch() promise only rejects when a network
error is encountered (which is usually when there’s a permissions issue or similar).
...And 5 more matches
Feature-Policy - HTTP
when this policy is disabled, the promise returned by navigator.getbattery() will reject with a notallowed
error domexception.
...when this policy is disabled, the promise returned by getusermedia() will reject with a notallowed
error domexception.
...when this policy is disabled, the promise returned by getdisplaymedia() will reject with a notallowed
error if permission is not obtained to capture the display's contents.
...And 5 more matches
HTTP response status codes - HTTP
responses are grouped in five classes: informational responses (100–199), successful responses (200–299), redirects (300–399), client
errors (400–499), and server
errors (500–599).
... client
error responses 400 bad request the server could not understand the request due to invalid syntax.
...the two mandatory methods, get and head, must never be disabled and should not return this
error code.
...And 5 more matches
JavaScript modules - JavaScript
if you don't, you'll get a strict mime type checking
error along the lines of "the server responded with a non-javascript mime type" and the browser won't run your javascript.
...if you omit it, firefox for example gives you an
error of "syntax
error: import declarations may only appear at top level of a module".
...with a file:// url), you'll run into cors
errors due to javascript module security requirements.
...And 5 more matches
Arrow function expressions - JavaScript
this code sample using chrome 81 demonstrates that arrow functions allow the creation of global variables in such situations (both for a concise body and for a normal function body): > f1 = x => { y = x; console.log(`x: ${x}, y: ${y}`); return x + 1; } x => { y = x; console.log(`x: ${x}, y: ${y}`); return x + 1; } > y vm51587:1 uncaught reference
error: y is not defined at <anonymous>:1:1 (anonymous) @ vm51587:1 > f1(3) vm51533:1 x: 3, y: 3 4 > y 3 > f2 = x => { 'use strict'; z = x; console.log(`x: ${x}, z: ${z}`); return x + 1; } x => { 'use strict'; z = x; console.log(`x: ${x}, z: ${z}`); return x + 1; } > z vm51757:1 uncaught reference
error: z is not defined at <anonymous>:1:1 (anonymous) @ vm51757:1 > f2(4) vm51712:1 uncaught r...
...eference
error: z is not defined at f2 (<anonymous>:1:29) at <anonymous>:1:1 f2 @ vm51712:1 (anonymous) @ vm51800:1 > f3 = x => (z1 = x + 1) x => (z1 = x + 1) > z1 vm51891:1 uncaught reference
error: z1 is not defined at <anonymous>:1:1 (anonymous) @ vm51891:1 > f3(10) 11 > z1 11 f2 illustrates that when explicitly setting the arrow function to apply strict mode, it does throw an
error when attempting to assign an undeclared variable.
...): 'use strict'; var obj = { a: 10 }; object.defineproperty(obj, 'b', { get: () => { console.log(this.a, typeof this.a, this); // undefined 'undefined' window {...} (or the global object) return this.a + 10; // represents global object 'window', therefore 'this.a' returns 'undefined' } }); use of the new operator arrow functions cannot be used as constructors and will throw an
error when used with new.
...And 5 more matches
Promise.prototype.catch() - JavaScript
the promise returned by catch() is rejected if onrejected throws an
error or returns a promise which is itself rejected; otherwise, it is resolved.
... note the examples below are throwing instances of
error.
... this is considered good practice in contrast to throwing strings; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an
error, and you might lose valuable information like stack traces.
...And 5 more matches
delete operator - JavaScript
exceptions throws type
error in strict mode if the property is an own non-configurable property.
...in strict mode this will raise a type
error.
...non-strict mode when in strict mode, if delete is used on a direct reference to a variable, a function argument or a function name, it will throw a syntax
error.
...And 5 more matches
async function - JavaScript
if you use it outside of an async function's body, you will get a syntax
error.
...as a result, we must be mindful of
error handling behavior when dealing with concurrent asynchronous operations.
... for example, in the following code an unhandled promise rejection
error will be thrown, even if a .catch handler has been configured further along the promise chain.
...And 5 more matches
Transitioning to strict mode - JavaScript
differences from non-strict to strict syntax
errors when adding 'use strict';, the following cases will throw a syntax
error before the script is executing: octal syntax var n = 023; with statement using delete on a variable name delete myvariable; using eval or arguments as variable or function argument name using one of the newly reserved keywords (in prevision for ecmascript 2015): implements, interface, let, package, private, protected...
..., public, static, and yield declaring function in blocks if (a < b) { function f() {} } obvious
errors declaring twice the same name for a property name in an object literal {a: 1, b: 3, a: 7} this is no longer the case in ecmascript 2015 (bug 1041128).
... declaring two function parameters with the same name function f(a, b, b) {} these
errors are good, because they reveal plain
errors or bad practices.
...And 5 more matches
Using Dependent Libraries In Extension Components - Archive of obsolete content
// assume that we're in <extensiondir>/components, and we want to find // <extensiondir>/libraries nscomptr<nsifile> libraries; rv = alocation->getparent(getter_addrefs(libraries)); if (ns_failed(rv)) return rv; nscomptr<nsilocalfile> library(do_queryinterface(libraries)); if (!library) return ns_
error_unexpected; library->setnativeleafname(ns_literal_cstring("libraries")); library->appendnative(ns_literal_cstring("dummy")); // loop through and load dependent libraries for (char const *const *dependent = kdependentlibraries; *dependent; ++dependent) { library->setnativeleafname(nsdependentcstring(*dependent)); prlibrary *lib; library->load(&lib); // 1) we...
... } library->setnativeleafname(ns_literal_cstring(krealcomponent)); prlibrary *lib; rv = library->load(&lib); if (ns_failed(rv)) return rv; nsgetmoduleproc getmoduleproc = (nsgetmoduleproc) pr_findfunctionsymbol(lib, ns_get_module_symbol); if (!getmoduleproc) return ns_
error_failure; return getmoduleproc(acompmgr, alocation, aresult); } extensions/stub/bdsstubloader.cpp (for mac os x) the code as written above won't work for mac os x.
... // assume that we're in <extensiondir>/components, and we want to find // <extensiondir>/libraries nscomptr<nsifile> libraries; rv = alocation->getparent(getter_addrefs(libraries)); if (ns_failed(rv)) return rv; nscomptr<nsilocalfile> library(do_queryinterface(libraries)); if (!library) return ns_
error_unexpected; library->setnativeleafname(ns_literal_cstring("libraries")); library->appendnative(ns_literal_cstring("dummy")); nscstring path; // loop through and load dependent libraries for (char const *const *dependent = kdependentlibraries; *dependent; ++dependent) { library->setnativeleafname(nsdependentcstring(*dependent)); rv = library->getnativepath(path); if (ns_fa...
...And 4 more matches
Twitter - Archive of obsolete content
(you can read about the parameters of the various methods at twitter's api reference.) there are two special, optional properties: success and
error.
... success is a function that's called when the request successfully completes, and
error is a function called when it fails to complete.
...
error(xmlhttprequest, textstatus,
errorthrown) xmlhttprequest is the xhr used in the request.
...And 4 more matches
XUL accessibility guidelines - Archive of obsolete content
provide users with clear instruction and feedback, and allow users to correct
errors.
...
error recovery when the user causes an
error in an application allow for graceful recovery.
...the user should be alerted to the problem and allowed to fix the
error.
...And 4 more matches
How do you make sure your website works properly? - Learn web development
500: internal server
error something went wrong on the server.
... so we fixed the
error and learned a few http statuses along the way!
... frequent
errors the most frequent
errors that we find are these: typos in the address we wanted to type http://demozilla.examplehostingprovider.net/ but typed too fast and forgot an “l”: the address cannot be found.
...And 4 more matches
Handling text — strings in JavaScript - Learn web development
if you don't do this, or miss one of the quotes, you'll get an
error.
...if the browser can't find it, then an
error is raised (e.g.
...if the browser can see where a string starts, but can't find the end of the string, as indicated by the 2nd quote, it complains with an
error (with "unterminated string literal").
...And 4 more matches
Storing the information you need — Variables - Learn web development
if they don't exist, you'll get an
error message — try typing in scoobydoo; note: don't confuse a variable that exists but has no defined value with a variable that doesn't exist at all — they are very different things.
...if we changed var to let in the above example, it would fail with an
error.
...the following would work: var myname = 'chris'; var myname = 'bob'; but the following would throw an
error on the second line: let myname = 'chris'; let myname = 'bob'; you'd have to do this instead: let myname = 'chris'; myname = 'bob'; again, this is a sensible language decision.
...And 4 more matches
Introducing a complete toolchain - Learn web development
code linting tools linting helps with code quality but also is a way to catch potential
errors earlier during development.
...here is an example eslint output: ./my-project/src/index.js 2:8
error 'react' is defined but never used no-unused-vars 22:20
error 'body' is defined but never used no-unused-vars 96:19
error 'b' is defined but never used no-unused-vars ✖ 3 problems (3
errors, 0 warnings) note: we'll install eslint in the next section; don't worry about this for now.
...it's not a prerequisite of developing for the web, but it's useful to have the tools configured correctly if they’re going to help catch
errors during development — which eslint is particularly useful for.
...And 4 more matches
mach
of course, in a random dir you just get a cryptic
error message to improve the experience.
... for full help: $ ./mach help try building the tree: $ ./mach build if you get
error messages, make sure that you have all of the build requisites for your system.
... another possible reason: mach gives you an
error, while running, say bootstrap.py directly (that is to type in a bash shell: python2 ./bootstrap.py enter-key ) in an otherwise empty ..../subdir/ may work for you!
...And 4 more matches
Storage access policy: Block cookies from trackers
dom storage: localstorage: window.localstorage: read and write attempts throw a security
error exception.
...thus, attempts to read and write using this object will throw a type
error exception.
... indexeddb: attempting to access the indexeddb factory object throws a security
error exception.
...And 4 more matches
IPDL Tutorial
this generated code manages the details of the underlying communication layer (sockets and pipes), constructing and sending messages, ensuring that all actors adhere to their specifications, and handling many
error conditions.
...on the other hand the reject/failure callbacks take a mozilla::ipc::responserejectreason&& and are called in case of a fatal
error, such as an ipc
error.
... for a protocol pfoo managed by pmanager, that manages pmanagee, the methods are pmanager* pfoo::manager() const infallibletarray<pmanagee*> pfoo::managedpmanagee(); void pfoo::managedpmanagee(infallibletarray<pmanagee*>&); shutdown and
error handling the c++ methods which implement ipdl messages return bool: true for success, and false for catastrophic failure.
...And 4 more matches
Downloads.jsm
properties attribute type description
error read only constructor constructor for a download
error object.
... when you catch an exception during a download, you can use this to verify if ex instanceof downloads.
error, before reading the exception properties with the
error details.
... example (using task.jsm): try { yield downloads.fetch(sourceuri, targetfile); } catch (ex if ex instanceof downloads.
error && ex.becausetargetfailed) { console.log("unable to write to the target file, ignoring the
error."); } methods createdownload() creates a new download object.
...And 4 more matches
L20n Javascript API
error - fired when an
error occurs which prevents the context instance from working correctly or when the existing translations are buggy.
... the
error object is passed as the first argument to callback.
... these
errors include: context.runtime
error, when an entity is missing or broken in all supported locales; in this case, l20n will show the the best available fallback of the requested entity in the ui: the source string as found in the resource, or the identifier.
...And 4 more matches
NSS 3.12.4 release notes
new functions in the nss shared library: pk11_isinternalkeyslot (see pk11pub.h) secmod_opennewslot (see pk11pub.h) new
error codes (see secerr.h): sec_
error_bad_info_access_method sec_
error_crl_import_failed new oids (see secoidt.h) sec_oid_x509_any_policy the nssckbi pkcs #11 module's version changed to 1.75.
... bug 321755: implement crldistributionpoint extension in libpkix bug 391434: avoid multiple encoding/decoding of pkix_pl_oid to and from ascii string bug 405297: problems building nss/lib/ckfw/capi/ with mingw gcc bug 420991: libpkix returns wrong nss
error code bug 427135: add super-h (sh3,4) architecture support bug 431958: improve des and sha512 for x86_64 platform bug 433791: win16 support should be deleted from nss bug 449332: secu_parsecommandline does not validate its inputs bug 453735: when using cert9 (sqlite3) db, set or change master password fails bug 463544: warning: passing enum* for an int* argument in pkix_validate.c bug 469588: coveri...
...ty
errors reported for softoken bug 470055: pkix_httpcertstore_findsocketconnection reuses closed socket bug 470070: multiple object leaks reported by tinderbox bug 470479: io timeout during cert fetching makes libpkix abort validation.
...And 4 more matches
JS::CompileOptions
methods of js::readonlycompileoptions method description bool muted
errors() const determines if
errors are muted.
...this allows an attack by which a malicious website loads a sensitive file (say, a bank statement) cross-origin (using the user's cookies), and sniffs the generated syntax
errors (via a window.on
error handler) for juicy morsels of its contents.
... to counter this attack, html5 specifies that script
errors should be sanitized ("muted") when the script is not same-origin with the global for which it is loaded.
...And 4 more matches
Using XPCOM Utilities to Make Things Easier
if (ns_failed(
error)) return; // <------------ leaks |value| //...
...if you handle an
error condition by returning prematurely, whatever value points at will leak-it will never be deleted.
... if (ns_failed(
error)) return; // ...
...And 4 more matches
nsIAccessibleEditableText
exceptions thrown ns_
error_failure indicates the text cannot be copied into the clipboard.
... exceptions thrown ns_
error_failure indicates the text cannot be deleted or copied into the clipboard.
... exceptions thrown ns_
error_failure indicates the text cannot be deleted.
...And 4 more matches
nsIContentPrefService
exceptions thrown ns_
error_illegal_value if agroup is not a string, nsiuri, or null.
...exceptions thrown ns_
error_illegal_value if agroup is not a string, nsiuri, or null.
...exceptions thrown ns_
error_illegal_value if aname is null or an empty string.
...And 4 more matches
nsIControllers
exceptions thrown ns_
error_out_of_memory getcontrollerat() returns the controller instance at the given position.
...exceptions thrown ns_
error_failure the given index is out of range.
...exceptions thrown ns_
error_failure the id is greater than the number of controllers that have been inserted, or the controller has since been removed.
...And 4 more matches
nsIFaviconService
this cache will also be written to if you use setandloadfaviconforpage() method and it encounters an
error while fetching an icon.
... exceptions thrown ns_
error_not_available thrown when we have never heard of this favicon url.
...exceptions thrown ns_
error_not_available thrown when we have never heard of this favicon url.
...And 4 more matches
nsILivemarkService
exceptions thrown ns_
error_invalid_arg if the folder id isn't known or identifies a folder that isn't a livemark container.
... ns_
error_malformed_uri if the site uri annotation has somehow been corrupted (and can't be turned into an nsiuri) getlivemarkidforfeeduri() determines whether the feed uri is a currently registered livemark.
... exceptions thrown ns_
error_invalid_arg if the folder id isn't known or identifies a folder that isn't a livemark container.
...And 4 more matches
nsIURI
exceptions thrown ns_
error_failure if host is not applicable to the uri scheme (e.g.
... exceptions thrown ns_
error_failure if hostport is not applicable to the uri scheme (e.g.
... exceptions thrown ns_
error_failure if password is not applicable to the uri scheme (e.g.
...And 4 more matches
nsIWebProgressListener
location_change_
error_page 0x00000002 this flag indicates that awebprogress redirected from the requested document to an internal page to show
error status, such as about:net
error, about:cert
error and so on.
...it might also be called if an
error occurs during network loading.
... astatus
error status code associated with the state change.
...And 4 more matches
The Valgrind Test Job
the valgrind test job builds the browser and runs it under valgrind, which can detect various common memory-related
errors.
... understanding
errors for each problem that valgrind finds, it emits a message describing the problem, along with a stack trace indicating where the problem occurs.
... it also prints a suppression, which is a sequence of text that can be put in a suppression file (and specified via valgrind's --suppressions option) if you want valgrind to ignore such
errors in future runs.
...And 4 more matches
nsIMsgCloudFileProvider
; void deletefile(in nsilocalfile afile, in nsirequestobserver acallback); void createnewaccount(in acstring aemailaddress, in acstring apassword, in acstring afirstname, in acstring alastname, in nsirequestobserver acallback); void createexistingaccount(in nsirequestobserver acallback); acstring providerurlfor
error(in unsigned long a
error); attributes attribute type description type acstring readonly: the type is a unique string identifier which can be used by interface elements for styling.
... last
error acstring readonly: the last
error message received from the server.
...this might change in the future, but as it stands, this function can simply return ns_
error_not_implemented unless there are plans to call createnewaccount from the management or settings xhtml files.
...And 4 more matches
Type conversion
if src == 1: true var mystruct = ctypes.structtype("mystructtype", [ { "v": ctypes.bool } ])(); mystruct.v = true; console.log(mystruct.v.tostring()); // 'true' mystruct.v = false; console.log(mystruct.v.tostring()); // 'false' mystruct.v = 1; console.log(mystruct.v.tostring()); // 'true' mystruct.v = 0; console.log(mystruct.v.tostring()); // 'false' mystruct.v = 10; // throws
error mystruct.v = "a"; // throws
error integer types target type source converted value ctypes.char16_t js string (only if its length == 1) src.charcodeat(0) any integer types js number (only if fits to the size) src js boolean if src == true: 1 if src == false: 0 var mystruct = ctypes.structtype("mystructtype", [ ...
...{ "v": ctypes.char16_t } ])(); mystruct.v = 0x41; console.log(mystruct.v.tostring()); // "a" mystruct.v = true; console.log(mystruct.v.tostring()); // "\x01" mystruct.v = "x"; console.log(mystruct.v.tostring()); // "x" mystruct.v = "xx"; // throws
error var mystruct = ctypes.structtype("mystructtype", [ { "v": ctypes.int16_t } ])(); mystruct.v = 0x41; console.log(mystruct.v.tostring()); // 65 mystruct.v = true; console.log(mystruct.v.tostring()); // 1 mystruct.v = "x"; // throws
error integer/float types are implicitly convertible if any data of source type could be representable in the target type.
... ctypes.signed_char ctypes.int8_t ctypes.unsigned_char ctypes.uint8_t ctypes.char16_t ctypes.uint8_t ctypes.uint16_t ctypes.unsigned_short var mystruct = ctypes.structtype("mystructtype", [ { "v": ctypes.int16_t } ])(); mystruct.v = ctypes.int8_t(10); console.log(mystruct.v.tostring()); // 10 mystruct.v = ctypes.int32_t(10); // throws
error float types target type source converted value any float types js number (only if fits to the size) src pointer types target type source converted value any pointer types null nullptr ctypes.voidptr_t any pointer types src any array types src.addressofelement(0) ctypes.pointertype(t) ...
...And 4 more matches
Debugger.Frame - Firefox Developer Tools
for a wasmcall frame, this property throws a type
error.
...for a wasmcall frame, this property throws a type
error.
...when the referent frame is popped, the argument value’s properties’ getters throw an
error.
...And 4 more matches
Cache - Web APIs
note that an http
error response (e.g., 404) will not trigger an exception.
... it will return a normal response object that has the appropriate
error code.
... return fetch(event.request.clone()).then(function(response) { console.log(' response for %s from network is: %o', event.request.url, response); if (response.status < 400 && response.headers.has('content-type') && response.headers.get('content-type').match(/^font\//i)) { // this avoids caching responses that we know are
errors (i.e.
...And 4 more matches
Document - Web APIs
document.onfullscreen
error is an eventhandler representing the code to be called when the fullscreen
error event is raised.
... globaleventhandlers.on
error is an on
erroreventhandler representing the code to be called when the
error event is raised.
... globaleventhandlers.onpointerlock
error is an eventhandler representing the code to be called when the pointerlock
error event is raised.
...And 4 more matches
FileSystemDirectoryEntry - Web APIs
if you try creating a directory using a full path that includes parent directories that do not exist yet, an
error is returned.
... function onfs(fs){ fs.root.getdirectory('documents', {create:true}, function(directoryentry){ //directoryentry.isfile === false //directoryentry.isdirectory === true //directoryentry.name === 'documents' //directoryentry.fullpath === '/documents' }, on
error); } // opening a file system with temporary storage window.requestfilesystem(temporary, 1024*1024 /*1mb*/, onfs, on
error); properties this interface has no properties of its own, but inherits properties from its parent interface, filesystementry.
...ng internet android full support yesgetdirectory experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the
errorcallback's input parameter is a domexception rather than a file
error object.ie no support noopera no support nosafari full support 11.1webview android full support ≤37chrome android full support ...
...And 4 more matches
FileSystemEntry.getParent() - Web APIs
syntax filesystementry.getparent(successcallback[,
errorcallback]); parameters successcallback a function which is called when the parent directory entry has been retrieved.
...
errorcallback optional an optional callback which is executed if an
error occurs.
... there's a single parameter: a file
error describing what went wrong.
...And 4 more matches
FileSystemFileEntry.file() - Web APIs
syntax filesystemfileentry.file(successcallback[,
errorcallback]); parameters successcallback a callback function which is called when the file has been created successfully; the file is passed into the callback as the only parameter.
...
errorcallback optional if provided, this must be a method which is called when an
error occurs while trying to create the file.
... this callback receives as input a file
error object describing the
error.
...And 4 more matches
Introduction to the File and Directory Entries API - Web APIs
it also describes restrictions that raise security
errors if you ignore them.
...you start using the file and directory entries api, you need to understand a few concepts: the file and directory entries api is a virtual representation of a file system the file and directory entries api can use different storage types browsers impose storage quota the file and directory entries api has asynchronous and synchronous versions when using the asynchronous api, always use the
error callbacks the file and directory entries api interacts with other apis the file and directory entries api is case-sensitive the file and directory entries api is a virtual representation of a file system the api doesn't give you access to the local file system, nor is the sandbox really a section of the file system.
... when using the asynchronous api, always use the
error callbacks when using the asynchronous api, always use the
error callbacks.
...And 4 more matches
IDBDatabase - Web APIs
error fired when a request returns an
error and the event bubbles up to the connection object.
... also available via the on
error property.
... example in the following code snippet, we open a database asynchronously (idbfactory), handle success and
error cases, and create a new object store in the case that an upgrade is needed (idbdatabase).
...And 4 more matches
MediaSource.endOfStream() - Web APIs
syntax mediasource.endofstream(endofstream
error); parameters endofstream
error optional a domstring representing an
error to throw when the end of the stream is reached.
... the possible values are: network: terminates playback and signals that a network
error has occured.
... this can be used create a custom
error handler related to media streams.
...And 4 more matches
RTCPeerConnection.createOffer() - Web APIs
errorcallback an rtcpeerconnection
errorcallback which will be passed a single domexception object explaining why the request to create an offer failed.
... invalidstate
error the rtcpeerconnection is closed.
... notreadable
error no certificate or set of certificates was provided for securing the connection, and createoffer() was unable to create a new one.
...And 4 more matches
RTCPeerConnection.setLocalDescription() - Web APIs
syntax apromise = rtcpeerconnection.setlocaldescription(sessiondescription); pc.setlocaldescription(sessiondescription, successcallback,
errorcallback); parameters sessiondescription optional an rtcsessiondescriptioninit or rtcsessiondescription which specifies the configuration to be applied to the local end of the connection.
...
errorcallback a function matching the signature rtcpeerconnection
errorcallback which gets called if the description can't be set.
... this deprecated form of the method returns instantaneously without waiting for the actual setting to be done: in case of success, the successcallback will be called; in case of failure, the
errorcallback will be called.
...And 4 more matches
ReadableStream.pipeThrough() - Web APIs
the method will return a fulfilled promise once this process completes, unless an
error is encountered while closing the destination in which case it will be rejected with that
error.
... preventabort: if this is set to true,
errors in the source readablestream will no longer abort the destination writablestream.
... the method will return a promise rejected with the source’s
error, or with any
error that occurs during aborting the destination.
...And 4 more matches
Window - Web APIs
globaleventhandlers.onclose called after the window is closed globaleventhandlers.oncontextmenu called when the right mouse button is pressed globaleventhandlers.on
error called when a resource fails to load or when an
error occurs at runtime.
... see
error event.
...
error fired when a resource failed to load, or can't be used.
...And 4 more matches
Audio and Video Delivery - Developer guides
lement: <video id="webcam" width="480" height="360"></video> next, if supported connect the webcam source to the video element: if (navigator.mediadevices) { navigator.mediadevices.getusermedia({ video: true, audio: false }) .then(function onsuccess(stream) { var video = document.getelementbyid('webcam'); video.autoplay = true; video.srcobject = stream; }) .catch(function on
error() { alert('there has been a problem retreiving the streams - are you running on file:/// or did you disallow access?'); }); } else { alert('getusermedia is not supported in this browser.'); } to find out more, read our mediadevices.getusermedia page.
... the main mechanism is outlined below: navigator.mediadevices.getusermedia({audio:true}) .then(function onsuccess(stream) { var recorder = new mediarecorder(stream); var data = []; recorder.ondataavailable = function(e) { data.push(e.data); }; recorder.start(); recorder.on
error = function(e) { throw e.
error || new
error(e.name); // e.name is ff non-spec } recorder.onstop = function(e) { var audio = document.createelement('audio'); audio.src = window.url.createobjecturl(new blob(data)); } settimeout(function() { rec.stop(); }, 5000); }) .catch(function on
error(
error) { console.log(
error.message); }); see mediarecord...
...
error handling starting in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1),
error handling has been revised to match the latest version of the html5 specification.
...And 4 more matches
constructor - JavaScript
if your class is a base class, the default constructor is empty: constructor() {} if your class is a derived class, the default constructor calls the parent constructor, passing along any arguments that were provided: constructor(...args) { super(...args); } that enables code like this to work: class validation
error extends
error { printcustomermessage() { return `validation failed :-( (details: ${this.message})`; } } try { throw new validation
error("not a valid phone number"); } catch (
error) { if (
error instanceof validation
error) { console.log(
error.name); // this is
error instead of validation
error!
... console.log(
error.printcustomermessage()); } else { console.log('unknown
error',
error); throw
error; } } the validation
error class doesn't need an explicit constructor, because it doesn't need to do any custom initialization.
... the default constructor then takes care of initializing the parent
error from the argument it is given.
...And 4 more matches
Object.freeze() - JavaScript
any attempt to do so will fail, either silently or by throwing a type
error exception (most commonly, but not exclusively, when in strict mode).
... in es5, if the argument to this method is not an object (a primitive), then it will cause a type
error.
... > object.freeze(1) type
error: 1 is not an object // es5 code > object.freeze(1) 1 // es2015 code an arraybufferview with elements will cause a type
error, as they are views over memory and will definitely cause other possible issues: > object.freeze(new uint8array(0)) // no elements uint8array [] > object.freeze(new uint8array(1)) // has elements type
error: cannot freeze array buffer views with elements > object.freeze(new dataview(new arraybuffer(32))) // no elements dataview {} > object.freeze(new float64array(new arraybuffer(64), 63, 0)) // no elements float64array [] > object.freeze(new float64array(new arraybuffer(64), 32, 2)) // has elements...
...And 4 more matches
WebAssembly - JavaScript
providing facilities to handle
errors that occur in webassembly via the webassembly.compile
error()/webassembly.link
error()/webassembly.runtime
error() constructors.
... constructor properties webassembly.compile
error() indicates an
error during webassembly decoding or validation.
... webassembly.instance() is a stateful, executable instance of a webassembly.module webassembly.link
error() indicates an
error during module instantiation (besides traps from the start function).
...And 4 more matches
Optional chaining (?.) - JavaScript
chaining operator, except that instead of causing an
error if a reference is nullish (null or undefined), the expression short-circuits with a return value of undefined.
...this prevents the
error that would occur if you simply accessed obj.first.second directly without testing obj.first.
...will still raise a type
error exception (someinterface.custommethod is not a function).
...And 4 more matches
try...catch - JavaScript
try { throw 'myexception'; // generates an exception } catch (e) { // statements to handle any exceptions logmy
errors(e); // pass exception object to
error handler } the catch-block specifies an identifier (e in the example above) that holds the value of the exception; this value is only available in the scope of the catch-block.
... conditional catch-blocks you can create "conditional catch-blocks" by combining try...catch blocks with if...else if...else structures, like this: try { myroutine(); // may throw three types of exceptions } catch (e) { if (e instanceof type
error) { // statements to handle type
error exceptions } else if (e instanceof range
error) { // statements to handle range
error exceptions } else if (e instanceof eval
error) { // statements to handle eval
error exceptions } else { // statements to handle any unspecified exceptions logmy
errors(e); // pass exception object to
error handler } } a common use case for this is to only catch (and silence) a small subset of expected
errors, and then re-throw the
error in other cases: try { myroutine(); } catch (e) { if (e inst...
...anceof range
error) { // statements to handle this very common expected
error } else { throw e; // re-throw the
error unchanged } } the exception identifier when an exception is thrown in the try-block, exception_var (i.e., the e in catch (e)) holds the exception value.
...And 4 more matches
test/assert - Archive of obsolete content
throws(block,
error, message) assert that a block of code throws the expected exception.
... this method takes an optional
error argument: to check that the exception thrown is of the expected type, pass a constructor function: the exception thrown must be an instance of the object returned by that function.
... to check that the exception thrown contains a specific message, pass a regular expression here: the message property of the exception thrown must match the regular expression for example, suppose we define two different custom exceptions: function my
error(message) { this.name = "my
error"; this.message = message || "default message"; } my
error.prototype = new
error(); my
error.prototype.constructor = my
error; function another
error(message) { this.name = "another
error"; this.message = message || "default message"; console.log(this.message); } another
error.prototype = new
error(); another
error.prototype.constructor = another
error; we can check the type of exception by passing a function as the
error argument: exports["test exception type 1 expected to pass"] = function(...
...And 3 more matches
Promises - Archive of obsolete content
a task example like the following: components.utils.import("resource://gre/modules/task.jsm"); task.spawn(function* () { var response = yield request("login", { username: user, password: password }); if (response.messages) { try { yield publish({ username: user, messages: response.messages }); } catch (e) { self.report
error("publication failed", e); } } }); can be converted to a pure promise-based equivalent as such: request("login", { username: user, password: password }) .then(response => { if (response.messages) return publish({ username: user, messages: response.messages }); }) .then(null, (e) => { self.report
error("publication failed", e); }); file io ...
... let resp = yield new promise((resolve, reject) => { let xhr = new xmlhttprequest; xhr.onload = resolve; xhr.on
error = reject; xhr.open("get", dataurl); xhr.responsetype = "json"; xhr.send(); }); let data = resp.target.response; // use the response to construct form data object for the // second request.
... resp = yield new promise((resolve, reject) => { let xhr = new xmlhttprequest; xhr.onload = resolve; xhr.on
error = reject; xhr.open("post", updateurl); xhr.send(form); }); // use the response of the second request.
...And 3 more matches
Dehydra Function Reference - Archive of obsolete content
include example include("map.js") // includes map.js into toplevel var map = {} include("map.js", map) // includes map.js into the map object require({version:, strict:, w
error:, gczeal:}) require is used to set runtime execution flags.
...strict boolean: controls js strict mode w
error boolean: turns js warnings into
errors gczeal int: this is a write-only parameter to set turn on frequent garbage collection.
... require() example require({strict:true, gczeal:2}) if (require().w
error) print("w
error is set") warning([code,] msg [, loc]) print a warning message using the gcc warning mechanism.
...And 3 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
ll(software_name, plid, version); if (err != 0) { // install may have failed because of n6 and = // replace plid with a simple string err = initinstall(software_name, "mypluginstring", version); if (err != 0) cancelinstall(err); } note that above, the plid contains an "=" and in case the xpi package is running on browsers that treat "=" as an illegal token, the workaround is to handle the
error and invoke initinstall again.
... err = getlast
error(); if (!err) performinstall(); else cancelinstall(err); installing plugin files to the current browser installing to the current browser is the task that is the most important for the xpi package to succeed in.
...
error code "+err); logcomment("adding file "+plugin_file+" failed.
...And 3 more matches
Learn XPI Installer Scripting by Example - Archive of obsolete content
in the browser.xpi installation, this function appears at line 20: var err = initinstall("netscape seamonkey", "browser", "6.0.0.2000110807"); if you call a method on the install object before initinstall(), you will get an
error.
...recall that an install process takes the following general form: initinstall(); if (verify_space()) { err = add_dirs_and_files; register_files; if (err==success) { performinstall() }; else { cancelinstall() }; } in this arrangement, the actual execution of the installation is checked against the
errors returned from the addition of files to the installation, which may itself have been conditioned on some verification of version and necessary disk space.
... the actual install code used to execute the installation appears in theinstall.js file as follows: if (err==success) { err = performinstall(); logcomment("performinstall() returned: " + err); } else { cancelinstall(err); logcomment("cancelinstall() due to
error: " + err); } } else cancelinstall(insufficient_disk_space); performinstall is the function used to execute the install once it has been initialized and loaded, and it is the last step to installing the software.
...And 3 more matches
Moving, Copying and Deleting Files - Archive of obsolete content
other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related
error codes.
...naturally, the destination must be a directory or an
error will occur.
... a number of
errors could occur when copying a file, for instance if the file to copy does not exist or the destination directory is not writable.
...And 3 more matches
Building XULRunner with Python - Archive of obsolete content
this page provides instructions in the hope of eliminating much trial and
error.
... development machine setup first a word of warning that zonealarm has exhibited memory leaks that cause build machines to crash with rather spurious
errors.
... unhandled exceptions are displayed in the javascript
error console which can be opened usingxulrunner -jsconsole.
...And 3 more matches
2006-11-24 - Archive of obsolete content
however he has been unsuccessful and a bunch of
errors.
... to view the joe's
error please check the posting.
...he is receiving the following
error:
error: uncaught exception: [exception...
...And 3 more matches
NPN_GetValue - Archive of obsolete content
syntax #include <npapi.h> np
error npn_getvalue(npp instance, npnvariable variable, void *value); parameters this function has the following parameters: instance pointer to the current plug-in instance.
...the value parameter should point to a npbool, which will be set appropriately if the function returns nperr_no_
error.
...the value parameter should point to an npbool, which will be set appropriately if the function returns nperr_no_
error.
...And 3 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
a similar
error can be seen in the following example: // wrong approach - do not use!
...netscape 7 corrects this
error and introduces another chance for user agent string based detection to fail.
...you can do this by providing an
error message for users of older browsers as well as alternative content contained in noscript tags.
...And 3 more matches
Old Proxy API - Archive of obsolete content
if one of the fundamental traps isn't implemented and the proxy is used in a way that expects the fundamental trap to be defined, then an
error is thrown.
... if fix() returns undefined, the call throws a type
error exception.
...however, if a fundamental trap is unimplemented, then a call to this trap will throw a type
error.
...And 3 more matches
Troubleshooting XForms Forms - Archive of obsolete content
introduction the idea of this page is to collect some solutions to some of the common
errors typically made when creating an xforms form.
...it checks your form for a lot of
errors.
... it is not perfect, but it can spot a lot of
errors.
...And 3 more matches
Packet - MDN Web Docs Glossary: Definitions of Web-related terms
it consists of network addresses for the source and destination, sequencing information, and
error detection codes and is generally found in packet headers and footer.
...
error detection and correction
error detection and correction are codes that are used to detect and apply corrections to the
errors that occur when data is transmitted to the receiver.
... there are two types of
error corrections backward and forward
error correction.
...And 3 more matches
Functions — reusable blocks of code - Learn web development
in addition, attempting to declare the name variable a second time with the let keyword in the second.js file results in an
error.
... now try entering the following in your console output(y); output(z); both of these should return an
error along the lines of "reference
error: y is not defined".
... finally, try updating your code like this: function a() { let y = 2; output(z); } function b() { let z = 3; output(y); } save and reload again, and try this again in your javascript console: a(); b(); this time the a() and b() calls will both return an annoying reference
error: variable name is not defined
error — this is because the output() calls and the variables they are trying to print are not in the same function scopes — the variables are effectively invisible to those function calls.
...And 3 more matches
Fetching data from the server - Learn web development
add this next: request.responsetype = 'text'; fetching a resource from the network is an asynchronous operation, meaning that you have to wait for that operation to complete (e.g., the resource is returned from the network) before you can do anything with that response, otherwise, an
error will be thrown.
... to handle
errors, we chain a .catch() block onto the end of the chain.
...inside it, we include a function that is passed as a parameter, an
error object.
...And 3 more matches
What is JavaScript? - Learn web development
if the javascript loads and tries to run before the html and css it is affecting has been loaded,
errors can occur.
... if you swapped the order of the first two lines of code, it would no longer work — instead, you'd get an
error returned in the browser developer console — type
error: para is undefined.
... note: this is a very common
error — you need to be careful that the objects referenced in your code exist before you try to do stuff to them.
...And 3 more matches
Application cache implementation overview
note: whenever a load of an items (including the manifest) fails due to a network or server
error or leads to a redirect, the update fails and completely rollbacks any changes made (i.e.
... if the manifest load failed, on
error event is invoked and the update 'finishes'.
...otherwise, the update invokes on
error and 'finishes'.
...And 3 more matches
Implementing QueryInterface
a reference implementation of queryinterface ns_imethodimp nsmyimplementation::queryinterface( refnsiid aiid, void** ainstanceptr ) { ns_assertion(ainstanceptr, "queryinterface requires a non-null destination!"); // it's a logic
error, not a runtime
error, to call me without any place to put my answer!
... if ( !ainstanceptr ) return ns_
error_null_pointer; nsisupports* foundinterface; if ( aiid.equals(nscomtypeinfo<nsix>::getiid()) ) foundinterface = ns_static_cast(nsix*, this); else if ( aiid.equals(nscomtypeinfo<nsiy>::getiid()) ) foundinterface = ns_static_cast(nsiy*, this); // ...as many cases as needed...
... it addrefs the resulting interface, not this, thus following the com-correct way (particularly important in aggregation) it uses nscomtypeinfo<t>::getiid() instead of ktiid thus saving a global declaration and global space it uses c 's static_cast, via ns_static_cast, which detects
errors when you can't really get to the desired interface.
...And 3 more matches
Log.jsm
log.addappender(new log.dumpappender(new log.basicformatter())); // log some messages log.
error("oh noes!!
... something bad happened!"); log.debug("details about bad thing only useful during debugging", {someinfo: "nothing"}); log.warn("here is an
error", new
error("ouch")); logger levels fatal severe
errors that cause premature termination.
...
error other runtime
errors or unexpected conditions.
...And 3 more matches
Bootstrapping a new locale
netwerk not
error ?
...we'll first navigate to the directory called "browser" by running the following commands one after the other from your command line: $ cd [ab-cd]/browser/chrome/browser to see what is contained in "browser" type $ ls and, you should see the following output from your terminal: aboutcert
error.dtd pageinfo.dtd aboutdialog.dtd pageinfo.properties aboutprivatebrowsing.dtd pagereportfirsttime.dtd aboutrobots.dtd places aboutsessionrestore.dtd preferences aboutsupport.dtd quitdialog.properties basemenuoverlay.dtd safemode.dtd browser.dtd safebrowsing browser.properties sa...
... (read more about tools at l10n:tools.) after you have downloaded your editor of choice, type the following command in the same path from above (~/ab-cd/browser/chrome/browser) $ edit ab-cd/browser/chrome/browser/aboutcert
error.dtd read the top of the file to get any context on how to translate contained in the notes written by the developers or l10n-drivers.
...And 3 more matches
Localizing without a specialized tool
you should see something like this: x-testing browser chrome browser aboutcert
error.dtd // add and localize this file aboutdialog.dtd +aboutlink +aboutlink.accesskey +aboutversion +closecmdgnome.accesskey +closecmdgnome.label +copyright +copyright.accesskey +copyrightgnome.accesskey +copyrightinfo1 +copyrightinfo2 +licenselink ...
... you should see // add and localize this file aboutcert
error.dtd notice from the compare-locales output that this file is located in the directory /browser/chrome/browser.
... type the command pwd again, make sure you are in /path/to/your/working/directory/l10n-mozilla-1.9.2/x-testing and then type the command mkdir /browser/chrome/browser now, copy the file by typing cp mozilla-1.9.2/browser/locales/chrome/browser/aboutcert
error.dtd l10n-mozilla-1.9.2/x-testing/browser/chrome/browser/aboutcert
error.dtd you should now see the aboutcert
error.dtd file in that newly created directory.
...And 3 more matches
Encrypt Decrypt MAC Keys As Session Objects
"could not authenticate to token %s.\n", pk11_gettokenname(slot)); if (slot) { pk11_freeslot(slot); } return null; } } key = pk11_findfixedkey(slot, mechanism, keybuf, 0); if (!key) { pr_fprintf(pr_stderr, "pk11_findfixedkey failed (err %d)\n", pr_get
error()); pk11_freeslot(slot); return null; } return key; } /* * decrypt and verify mac */ secstatus decryptandverifymac(const char* outfilename, char *encryptedfilename, secitem *citem, secitem *macitem, pk11symkey* ek, pk11symkey* mk, secitem *ivitem, secitem *paditem) { secstatus rv; prfiledesc* infile; prfiledesc* outfile; unsigned ...
... if (decbuflen == 0) break; rv = macupdate(ctxmac, decbuf, decbuflen); if (rv != secsuccess) { goto cleanup; } if (count == filelength) { decbuflen = decbuflen-paddinglength; } /* write the plain text to out file */ temp = pr_write(outfile, decbuf, decbuflen); if (temp != decbuflen) { pr_fprintf(pr_stderr, "write
error\n"); rv = secfailure; break; } /* save last block of ciphertext */ memcpy(iv, decbuf, decbuflen); ivlen = decbuflen; blocknumber++; } if (rv != secsuccess) { goto cleanup; } rv = macfinal(ctxmac, newmac, &newmaclen, sizeof(newmac)); if (rv != secsuccess) { goto cleanup; } if (port_memcmp(macitem->data, newmac,...
... generatesymkey(slot, ckm_generic_secret_key_gen, 160/8, &mackeyid, pwdata); if (mackey == null) { pr_fprintf(pr_stderr, "generatesymkey for macing returned null.\n"); rv = secfailure; goto cleanup; } /* get the encrypt key cka_id */ rv = gathercka_id(enckey, &encckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "
error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_set
error(pr_end_of_...
...And 3 more matches
Encrypt and decrypt MAC using token
"could not authenticate to token %s.\n", pk11_gettokenname(slot)); if (slot) { pk11_freeslot(slot); } return null; } } key = pk11_findfixedkey(slot, mechanism, keybuf, 0); if (!key) { pr_fprintf(pr_stderr, "pk11_findfixedkey failed (err %d)\n", pr_get
error()); pk11_freeslot(slot); return null; } return key; } /* * decrypt and verify mac */ secstatus decryptandverifymac(const char* outfilename, char *encryptedfilename, secitem *citem, secitem *macitem, pk11symkey* ek, pk11symkey* mk, secitem *ivitem, secitem *paditem) { secstatus rv; prfiledesc* infile; prfiledesc* outfile; unsigned ...
... if (decbuflen == 0) break; rv = macupdate(ctxmac, decbuf, decbuflen); if (rv != secsuccess) { goto cleanup; } if (count == filelength) { decbuflen = decbuflen-paddinglength; } /* write the plain text to out file */ temp = pr_write(outfile, decbuf, decbuflen); if (temp != decbuflen) { pr_fprintf(pr_stderr, "write
error\n"); rv = secfailure; break; } /* save last block of ciphertext */ memcpy(iv, decbuf, decbuflen); ivlen = decbuflen; blocknumber++; } if (rv != secsuccess) { goto cleanup; } rv = macfinal(ctxmac, newmac, &newmaclen, sizeof(newmac)); if (rv != secsuccess) { goto cleanup; } if (port_memcmp(macitem->data, newmac,...
... generatesymkey(slot, ckm_generic_secret_key_gen, 160/8, &mackeyid, pwdata); if (mackey == null) { pr_fprintf(pr_stderr, "generatesymkey for macing returned null.\n"); rv = secfailure; goto cleanup; } /* get the encrypt key cka_id */ rv = gathercka_id(enckey, &encckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "
error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_set
error(pr_end_of_...
...And 3 more matches
Encrypt Decrypt_MAC_Using Token
"could not authenticate to token %s.\n", pk11_gettokenname(slot)); if (slot) { pk11_freeslot(slot); } return null; } } key = pk11_findfixedkey(slot, mechanism, keybuf, 0); if (!key) { pr_fprintf(pr_stderr, "pk11_findfixedkey failed (err %d)\n", pr_get
error()); pk11_freeslot(slot); return null; } return key; } /* * decrypt and verify mac.
...*/ temp = pr_write(outfile, decbuf, decbuflen); if (temp != decbuflen) { pr_fprintf(pr_stderr, "write
error\n"); rv = secfailure; break; } /* save last block of ciphertext.
... generatesymkey(slot, ckm_generic_secret_key_gen, 160/8, &mackeyid, pwdata); if (mackey == null) { pr_fprintf(pr_stderr, "generatesymkey for macing returned null.\n"); rv = secfailure; goto cleanup; } /* get the encrypt key cka_id */ rv = gathercka_id(enckey, &encckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "
error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_set
error(pr_end_of_...
...And 3 more matches
NSS environment variables
3.4 nss_strict_nofork string ("1", "disabled", or any other non-empty value) it is an
error to try to use a pkcs#11 crypto module in a process before it has been initialized in that process, even if the module was initialized in the parent process.
... beginning in nss 3.12.3, softoken will detect this
error.
... this environment variable controls softoken's response to that
error.
...And 3 more matches
JSDeletePropertyOp
this callback may veto the ongoing property operation by optionally reporting an
error or raising an exception and then returning false.
... the operation then fails, and the
error is propagated to the caller.
... if an
error occurred, return false as per normal jsapi
error practice.
...And 3 more matches
JS_DeleteProperty
no property is deleted, but this is not an
error.
...no property is deleted, but this is not an
error.
...if the hook returns false, the
error is propagated.
...And 3 more matches
JS_DeleteProperty2
no property is deleted, but this is not an
error.
...no property is deleted, but this is not an
error.
...if the hook returns false, the
error is propagated.
...And 3 more matches
JS_PreventExtensions
before then, js_preventextensions did not accept a succeeded argument; in those cases where *succeeded would be set to false, js_preventextensions would throw a type
error and return false.
... unlike object.preventextensions, js_preventextensions doesn't necessarily throw a type
error if the object couldn't be made non-extensible.
... there are instead two modes of failure: through internal
error, and because the object denied the attempt.
...And 3 more matches
A Web PKI x509 certificate primer
error codes in firefox here are some common
errors that might be encountered when working with certificates in firefox.
...
error code what it means what can i do sec_
error_bad_der a certificate is not properly encoded according to asn.1 (der) encoding re-generate the improperly-encoded certificate sec_
error_ca_cert_invalid an end-entity certificate is being used to issue another certificate ensure that any certificate intended to issue certificates has a basic constraints extension with ca: true sec_
error_bad_signature a signature on a certificate is improperly formatted or the certificate has been tampered with re-issue the certificate with the bad signature sec_
error_cert_bad_access_location the ocsp uri in the authorityinformationaccess extension is improperly formed re-generate the certificate with a well-formed ocsp uri sec_e...
...rror_cert_not_in_name_space a certificate has a common name or subject alternative name that is not in the namespace of an issuing certificate re-issue the certificate with names that are within the namespace of all certificates in the chain sec_
error_cert_signature_algorithm_disabled a certificate has been signed with an obsolete algorithm re-sign the certificate using a modern algorithm sec_
error_expired_certificate a certificate is too old to be used re-generate the certificate sec_
error_extension_value_invalid a certificate has an extension with an empty value re-generate the certificate without the extension, or re-generate it with a non-empty value sec_
error_inadequate_cert_type a certificate has an extended key usage extensio...
...And 3 more matches
The Publicity Stream API
publicizeactivity( <activity>, [ { [ onsuccess: <function> ], [ on
error: <function> ] } ]): applications should call this method when an user-initiated activity deemed attractive to potential consumers occurs.
... on
error is an
error callback that will be invoked if the publicity fails.
... possible
error codes include: denied - if the user refuses to publicize the activity permissiondenied - if the publicizing site is not allowed to post to the publicity stream network
error - if the publicity server is unreachable activityparse
error - if the activity contains syntax
errors (not proper json) invalidactivity - if the activity contains semantic
errors (i.e.
...And 3 more matches
imgIContainer
exceptions thrown ns_
error_not_available if the animated state cannot be determined.
...in the case of any
error, zero is returned, and an exception will be thrown.
...in the case of any
error, zero is returned, and an exception will be thrown.
...And 3 more matches
mozIStorageStatementCallback
the mozistoragestatementcallback interface represents a callback handler that the storage api calls with result,
error, and completion notifications while handling asynchronous database queries.
... last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void handlecompletion(in unsigned short areason); void handle
error(in mozistorage
error a
error); void handleresult(in mozistorageresultset aresultset); constants constant value description reason_finished 0 the statement has finished executing normally.
... reason_
error 2 the statement stopped executing because an
error occurred.
...And 3 more matches
nsIAccessNode
propertyname); domstring getcomputedstylevalue(in domstring pseudoelt, in domstring propertyname); void scrollto(in unsigned long ascrolltype); void scrolltopoint(in unsigned long acoordinatetype, in long ax, in long ay); attributes note: attempting to access the attributes of a node that is unattached from the accessible tree will result in an exception - ns_
error_failure.
... exceptions thrown ns_
error_failure indicates that the access node is unattached from the accessible tree.
... exceptions thrown ns_
error_failure indicates that the access node is unattached from the accessible tree.
...And 3 more matches
nsICryptoHash
exceptions thrown ns_
error_not_initialized indicates that init() or initwithstring() has not been called.
... exceptions thrown ns_
error_invalid_arg indicates that an unsupported algorithm type was passed initwithstring() initialize the hashing object.
... exceptions thrown ns_
error_invalid_arg indicates that an unsupported algorithm type was passed update() adds an array of data to be hashed to the object.
...And 3 more matches
nsIDOMGeoGeolocation
ows an exception when importing, try using this: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsisupports); method overview void clearwatch(in unsigned short watchid); void getcurrentposition(in nsidomgeopositioncallback successcallback, [optional] in nsidomgeoposition
errorcallback
errorcallback, [optional] in nsidomgeopositionoptions options); unsigned short watchposition(in nsidomgeopositioncallback successcallback, [optional] in nsidomgeoposition
errorcallback
errorcallback, [optional] in nsidomgeopositionoptions options); attributes attribute ty...
...if this fails,
errorcallback is invoked with an nsidomgeoposition
error argument.
... void getcurrentposition( in nsidomgeopositioncallback successcallback, [optional] in nsidomgeoposition
errorcallback
errorcallback, [optional] in nsidomgeopositionoptions options ); parameters successcallback an nsidomgeopositioncallback to be called when the current position is available.
...And 3 more matches
nsIJumpListBuilder
lists are built in real-time during the sequence of build calls, make sure to check for
errors on each individual step.
...exceptions thrown ns_
error_not_available on all calls if taskbar functionality is not supported by the operating system.
...exceptions thrown ns_
error_unexpected on internal
errors.
...And 3 more matches
nsINavHistoryContainerResultNode
od overview nsinavhistoryresultnode findnodebydetails(in autf8string auristring, in prtime atime, in long long aitemid, in boolean arecursive); nsinavhistoryresultnode getchild(in unsigned long aindex); unsigned long getchildindex(in nsinavhistoryresultnode anode); attributes attribute type description childcount unsigned long the number of child nodes; accessing this throws an ns_
error_not_available exception of containeropen is false.
...when closed, attempting to call getchild() or access childcount results in an
error.
...exceptions thrown ns_
error_not_available the container is not open.
...And 3 more matches
nsIScriptableIO
other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related
error codes.
...exceptions thrown ns_
error_invalid_arg alocation was null.
...exceptions thrown ns_
error_invalid_arg afilepath was null.
...And 3 more matches
nsIAbCard/Thunderbird3
exceptions thrown ns_
error_not_available<tt> if the named property does not exist.
... <tt>ns_
error_cannot_convert_data if the property cannot be converted to the desired type.
... exceptions thrown ns_
error_not_available<tt> if the named property does not exist.
...And 3 more matches
Getting Started Guide
*/ ns_if_release(mfooptr); //
error: |release| is private mfooptr = afooptr; ns_if_addref(mfooptr); //
error: |addref| is private second: you can't just pass the address of an nscomptr to a getter expecting to return a result through a raw xpcom interface pointer parameter.
...do_queryinterface prevents xpcom type
errors.
...nscomptr<nsifoo> foo = p; // ...even though it is an xpcom // type
error class nsibar : public nsifoo ...
...And 3 more matches
Working with data
note: if type.size is undefined, creating a new object this way will throw a type
error exception.
...if the conversion isn't possible, type
error is thrown.
... if none of these conditions are met, a type
error is thrown.
...And 3 more matches
UInt64
exceptions thrown type
error the specified value cannot be converted into a 64-bit integer.
... exceptions thrown type
error one or both of the specified values is not a 64-bit integer (either signed or unsigned).
... exceptions thrown type
error num is not a 64-bit integer object.
...And 3 more matches
Drawing and Event Handling - Plugins
setting the window the browser calls the npp_setwindow function to set the window in which a plug-in draws or returns an
error code.
... np
error npp_setwindow(npp instance, npwindow *window); the instance parameter represents the current plug-in.
... np
error npn_getvalue(npp instance, npnvariable variable, void *value); the instance parameter represents the current plug-in.
...And 3 more matches
Element - Web APIs
element.onfullscreen
error an event handler for the fullscreen
error event, which is sent when an
error occurs while attempting to change into full-screen mode.
...
error fired when a resource failed to load, or can't be used.
... for example, if a script has an execution
error or an image can't be found or is invalid.
...And 3 more matches
FileException - Web APIs
in the file system api, a fileexception object represents
error conditions that you might encounter while accessing the file system using the synchronous api.
... it extends the fileexception interface described in file writer and adds several new
error codes.
... basic concepts synchronous apis do not have
error callbacks, which makes it difficult to catch
errors.
...And 3 more matches
FileSystemEntry.copyTo() - Web APIs
syntax filesystementry.copyto(newparent[, newname][, successcallback][,
errorcallback]); parameters newparent a filesystemdirectoryentry object specifying the destination directory for the copy operation.
...
errorcallback optional an optional callback which is executed if an
error occurs while copying the items.
... there's a single parameter: a file
error describing what went wrong.
...And 3 more matches
FileSystemEntry.getMetadata() - Web APIs
syntax filesystementry.getmetadata(successcallback[,
errorcallback]); parameters successcallback a function which is called when the copy operation is succesfully completed.
...
errorcallback optional an optional callback which is executed if an
error occurs while looking up the metadata.
... there's a single parameter: a file
error describing what went wrong.
...And 3 more matches
FileSystemEntry.moveTo() - Web APIs
syntax filesystementry.moveto(newparent[, newname][, successcallback][,
errorcallback]); parameters newparent a filesystemdirectoryentry object specifying the destination directory for the move operation.
...
errorcallback optional an optional callback which is executed if an
error occurs while moving the items.
... there's a single parameter: a file
error describing what went wrong.
...And 3 more matches
FileSystemFileEntry.createWriter() - Web APIs
syntax filesystemfileentry.createwriter(successcallback[,
errorcallback]); parameters successcallback a callback function which is called when the filewriter has been created successfully; the filewriter is passed into the callback as the only parameter.
...
errorcallback optional if provided, this must be a method which is caled when an
error occurs while trying to create the filewriter.
... this callback receives as input a file
error object describing the
error.
...And 3 more matches
Fullscreen API - Web APIs
event handlers the fullscreen api defines two events which can be used to detect when full-screen mode is turned on and off, as well as when
errors occur during the process of changing between full-screen and windowed modes.
...in other words, you cannot specify event handlers for fullscreenchange and fullscreen
error in the html content.
... document.onfullscreen
error an event handler for the fullscreen
error event that gets sent to a document when an
error occurs while trying to enable or disable full-screen mode for the entire document.
...And 3 more matches
IDBCursor.continuePrimaryKey() - Web APIs
calling this method more than once before new cursor data has been loaded - for example, calling continueprimarykey() twice from the same onsuccess handler - results in an invalidstate
error being thrown on the second call because the cursor’s got value flag has been unset.
...using it for cursors coming from an object store will throw an
error.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbcursor's transaction is inactive.
...And 3 more matches
MediaRecorder - Web APIs
mediarecorder.on
error an eventhandler called to handle the
error event, including reporting
errors that arise with media recording.
... these are fatal
errors that stop recording.
... the received event is based on the mediarecorder
errorevent interface, whose
error property contains a domexception that describes the actual
error that occurred.
...And 3 more matches
Navigator.getUserMedia() - Web APIs
if permission is denied, no compatible input devices exist, or any other
error condition occurs, the
error callback is executed with a mediastream
error object describing what went wrong.
... syntax navigator.getusermedia(constraints, successcallback,
errorcallback); parameters constraints a mediastreamconstraints object specifying the types of media to request, along with any requirements for each type.
... }; }
errorcallback when the call fails, the function specified in the
errorcallback is invokedwith a mediastream
error object as its sole argument; this object is is modeled on domexception.
...And 3 more matches
RTCRtpSender.setParameters() - Web APIs
exceptions if an
error occurs, the returned promise is rejected with the appropriate exception from the list below.
... invalidmodification
error one of the following problems was detected: the number of encodings specified in the parameters object's encodings property does not match the number of encodings currently listed for the rtcrtpsender.
... invalidstate
error the transceiver of which the rtcrtpsender is a part is not running, or has no parameters to set.
...And 3 more matches
WebRTC API - Web APIs
error an rtc
errorevent indicating that an
error occurred on the data channel.
...
error an rtc
errorevent indicating that an
error occurred on the rtcdtlstransport.
... this
error will be either dtls-failure or fingerprint-failure.
...And 3 more matches
WritableStreamDefaultWriter.close() - Web APIs
during this time any further attempts to write will fail (without
erroring the stream).
... return value a promise, which fulfills with the undefined if all remaining chunks were successfully written before the close, or rejects with an
error if a problem was encountered during the process.
... exceptions type
error the stream you are trying to close is not a writablestream.
...And 3 more matches
WritableStreamDefaultWriter - Web APIs
returns a promise that fulfills if the stream becomes closed or the writer's lock is released, or rejects if the stream
errors.
... methods writablestreamdefaultwriter.abort() aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an
error state, with any queued writes discarded.
...if the associated stream is
errored when the lock is released, the writer will appear
errored in the same way from now on; otherwise, the writer will appear closed.
...And 3 more matches
Synchronous and asynchronous requests - Web APIs
var xhr = new xmlhttprequest(); xhr.open("get", "/bar/foo.txt", true); xhr.onload = function (e) { if (xhr.readystate === 4) { if (xhr.status === 200) { console.log(xhr.responsetext); } else { console.
error(xhr.statustext); } } }; xhr.on
error = function (e) { console.
error(xhr.statustext); }; xhr.send(null); line 2 specifies true for its third parameter to indicate that the request should be handled asynchronously.
...if an
error occurred, an
error message is displayed.
... function xhrsuccess() { this.callback.apply(this, this.arguments); } function xhr
error() { console.
error(this.statustext); } function loadfile(url, callback /*, opt_arg1, opt_arg2, ...
...And 3 more matches
Accessibility Information for Web Authors - Accessibility
automated checking & repair cynthia says™ from hisoftware® company "cynthia says™" is a free online webpage accessibility validation service that is designed to identify
errors in webpage related to section 508 standards and/or the wcag guidelines.
...the web author chooses the guidelines (as a basis for
errors and warnings) to be used by "cynthia says™": section 508, wcag priorities 1, 2 and 3.
... wave 4.0 beta (web accessibility versatile evaluator) from webaim and sponsored by temple university institute on disabilities wave 4.0 beta is another powerful, free online webpage accessibility validation service that identifies accessibility
errors and reports accessibility warnings about webpage related to section 508 standards and/or the wcag guidelines.
...And 3 more matches
Meta programming - JavaScript
if you violate the invariants of a handler, a type
error will be thrown.
... in strict mode, a false value returned from the defineproperty handler will throw a type
error exception.
... in strict mode, a false return value from the set handler will throw a type
error exception.
...And 3 more matches
Array.prototype.reduce() - JavaScript
calling reduce() on an empty array without an initialvalue will throw a type
error.
... if the array is empty and no initialvalue is provided, type
error will be thrown.
...ck = ( acc, cur ) => math.max( acc.x, cur.x ); let maxcallback2 = ( max, cur ) => math.max( max, cur ); // reduce without initialvalue [ { x: 2 }, { x: 22 }, { x: 42 } ].reduce( maxcallback ); // nan [ { x: 2 }, { x: 22 } ].reduce( maxcallback ); // 22 [ { x: 2 } ].reduce( maxcallback ); // { x: 2 } [ ].reduce( maxcallback ); // type
error // map & reduce with initialvalue; better solution, also works for empty or larger arrays [ { x: 22 }, { x: 42 } ].map( el => el.x ) .reduce( maxcallback2, -infinity ); how reduce() works suppose the following use of reduce() occurred: [0, 1, 2, 3, 4].reduce(function(accumulator, currentvalue, currentindex, array) { return accumulator + currentvalue }) the callbac...
...And 3 more matches
JSON.stringify() - JavaScript
exceptions throws a type
error ("cyclic object value") exception when a circular reference is found.
... throws a type
error ("bigint value can't be serialized in json") when trying to stringify a bigint value.
... 'foo' }, [symbol.for('foo')]); // '{}' json.stringify({ [symbol.for('foo')]: 'foo' }, function(k, v) { if (typeof k === 'symbol') { return 'a symbol'; } }); // undefined // non-enumerable properties: json.stringify( object.create(null, { x: { value: 'x', enumerable: false }, y: { value: 'y', enumerable: true } }) ); // '{"y":"y"}' // bigint values throw json.stringify({x: 2n}); // type
error: bigint value can't be serialized in json the replacer parameter the replacer parameter can be either a function or an array.
...And 3 more matches
Object.defineProperty() - JavaScript
{ return bvalue; }, set(newvalue) { bvalue = newvalue; }, enumerable: true, configurable: true }); o.b; // 38 // 'b' property exists in the o object and its value is 38 // the value of o.b is now always identical to bvalue, // unless o.b is redefined // you cannot try to mix both: object.defineproperty(o, 'conflict', { value: 0x9f91102, get() { return 0xdeadbeef; } }); // throws a type
error: value appears // only in data descriptors, // get appears only in accessor descriptors modifying a property when the property already exists, object.defineproperty() attempts to modify the property according to the values in the descriptor and the object's current configuration.
... a type
error is thrown when attempts are made to change non-configurable property attributes (except value and writable, if permitted) unless the current and new values are the same.
... var o = {}; // creates a new object object.defineproperty(o, 'a', { value: 37, writable: false }); console.log(o.a); // logs 37 o.a = 25; // no
error thrown // (it would throw in strict mode, // even if the value had been the same) console.log(o.a); // logs 37.
...And 3 more matches
Object.preventExtensions() - JavaScript
attempting to add new properties to a non-extensible object will fail, either silently or by throwing a type
error (most commonly, but not exclusively, when in strict mode).
... this method makes the [[prototype]] of the target immutable; any [[prototype]] re-assignment will throw a type
error.
...var nonextensible = { removable: true }; object.preventextensions(nonextensible); object.defineproperty(nonextensible, 'new', { value: 8675309 }); // throws a type
error // in strict mode, attempting to add new properties // to a non-extensible object throws a type
error.
...And 3 more matches
Object.seal() - JavaScript
attempting to delete or add properties to a sealed object, or to convert a data property to accessor or vice versa, will fail, either silently or by throwing a type
error (most commonly, although not exclusively, when in strict mode code).
...object.defineproperty(obj, 'foo', { get: function() { return 'g'; } }); // throws a type
error // now any changes, other than to property values, // will fail.
... obj.quaxxor = 'the friendly duck'; // silently doesn't add the property delete obj.foo; // silently doesn't delete the property // ...and in strict mode such attempts // will throw type
errors.
...And 3 more matches
WebAssembly.instantiate() - JavaScript
there must be one matching property for each declared import of the compiled module or else a webassembly.link
error is thrown.
... exceptions if either of the parameters are not of the correct type or structure, a type
error is thrown.
... if the operation fails, the promise rejects with a webassembly.compile
error, webassembly.link
error, or webassembly.runtime
error, depending on the cause of the failure.
...And 3 more matches
WebAssembly
webassembly.compile
error() creates a new webassembly compile
error object.
... webassembly.link
error() creates a new webassembly link
error object.
... webassembly.runtime
error() creates a new webassembly runtime
error object.
...And 3 more matches
indexed-db - Archive of obsolete content
for example: window.indexeddb = window.indexeddb || window.webkitindexeddb || window.mozindexeddb || window.msindexeddb; var request = window.indexeddb.open("mydatabase"); request.on
error = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; because your main add-on code can't access the dom, you can't do this.
... so you can use the indexed-db module to access the same api: var { indexeddb } = require('sdk/indexed-db'); var request = indexeddb.open('mydatabase'); request.on
error = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; most of the objects that implement the indexeddb api, such as idbtransaction, idbopendbrequest, and idbobjectstore, are accessible through the indexeddb object itself.
... var { indexeddb, idbkeyrange } = require('sdk/indexed-db'); var database = {}; database.on
error = function(e) { console.
error(e.value) } function open(version) { var request = indexeddb.open("stuff", version); request.onupgradeneeded = function(e) { var db = e.target.result; e.target.transaction.on
error = database.on
error; if(db.objectstorenames.contains("items")) { db.deleteobjectstore("items"); } var store = db.createobjectstore("items", {keypath:...
...And 2 more matches
places/bookmarks - Archive of obsolete content
the placesemitter inherits from event/target, and emits data,
error, and end.
...
error the
error event is emitted whenever a bookmark item's save could not be completed.
... arguments string : a string indicating the
error that occurred.
...And 2 more matches
util/deprecate - Archive of obsolete content
globals functions deprecatefunction(fun, msg) dump to the console the
error message given in the second argument, prefixed with "deprecated:", and print the stacktrace; then execute the function passed as first argument and returns its value.
... it does not raise an exception, but just displays the
error message and continues to execute the function.
... parameters fun : function the function to execute after the
error message msg : string the
error message to display returns * : the returned value from fun deprecateusage(msg) dump to the console the
error message given, prefixed with "deprecated:", and print the stacktrace.
...And 2 more matches
jpm - Archive of obsolete content
to test your installation, run: /usr/bin/env node -v if you get an
error message saying /usr/bin/env: node: no such file or directory and you have installed nodejs through a package manager, nodejs may have been installed under a different executable name.
... --stop-on-
error by default, jpm test keeps running tests even after tests fail.
... specify --stop-on-
error to stop running tests after the first failure: jpm test --stop-on-
error --tbpl print test output in treeherder format --times number run tests number of times: jpm test --times 2 -v --verbose verbose operation.
...And 2 more matches
Finding window handles - Archive of obsolete content
stems: windows - hwnd mac os x - nswindow* linux - gdkwindow* (it will be gdkwindow* no matter what desktop/window manager) is in use, for explanation why see the article: standard os libraries - unix section) windows components.utils.import('resource://gre/modules/services.jsm'); var browserwindow = services.wm.getmostrecentwindow('navigator:browser'); if (!browserwindow) { throw new
error('no browser window found'); } var basewindow = browserwindow.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.n...
...pes.uint64(hwndstring)); var rez_setforegroundwindow = setforegroundwindow(hwnd); console.log('rez_setforegroundwindow:', rez_setforegroundwindow, rez_setforegroundwindow.tostring()); user32.close(); mac os x objective-c components.utils.import('resource://gre/modules/services.jsm'); var browserwindow = services.wm.getmostrecentwindow('navigator:browser'); if (!browserwindow) { throw new
error('no browser window found'); } var basewindow = browserwindow.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.n...
... examples gdk components.utils.import('resource://gre/modules/services.jsm'); var browserwindow = services.wm.getmostrecentwindow('navigator:browser'); if (!browserwindow) { throw new
error('no browser window found'); } var basewindow = browserwindow.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.n...
...And 2 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
it from an interface: const xmlhttprequest = components.constructor("@mozilla.org/xmlextras/xmlhttprequest;1", "nsixmlhttprequest"); here's how to load a file using it: function loadfile(url,type,returnresult) { var request = new xmlhttprequest(); request.open("get", url, true); // async=true request.responsetype = type; request.on
error = function(event) { log
errormessage("
error attempting to load: " + url); returnresult(null); }; request.onload = function(event) { if (request.response) returnresult(request.response); else request.on
error(event); }; request.send(); } loadfile("chrome://myaddon/content/filename.ext",datatype,function(data) { /* do stuff w...
...even though it says that the default type is "text", firefox will attempt to autodetect and fail, resulting in an
error message in the console.
...doing this will get an update's new properties file to load, however sometimes this will instead produce an
error on the next property access.
...And 2 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
the first tool is the built-in javascript console, shown in figure 1, where
errors and warnings are logged.
...javascript console the javascript console can show the full log list or just
errors, warnings, and messages.
... the
error message in figure 1 says that at aol.com, line 95 tries to access an undefined variable called is_ns70.
...And 2 more matches
cancelInstall - Archive of obsolete content
method of install object syntax void cancelinstall() void cancelinstall( int
errorcode ) parameters none.
... returns an integer
error code.
... the optional argument is an
error code that can be returned to the triggering page.
...And 2 more matches
Reading from Files - Archive of obsolete content
other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related
error codes.
...naturally, if the file does not exist, an
error will occur.
...in fact, it is a good idea to enclose file reading and writing operations within a try-catch block to capture any
errors that might occur during the process.
...And 2 more matches
Index - Archive of obsolete content
229 on
error xul attributes, xul reference no summary!
... 230 on
errorcommand xul attributes, xul reference no summary!
... 896
error-icon xul reference, xul_style_classes no summary!
...And 2 more matches
Using Visual Studio as your XUL IDE - Archive of obsolete content
5.1 localization using dtd you will get validation
errors in visual studio, if you are localizing your xul files.
... that has to do with the way mozilla implemented localization: < !doctype window system "chrome://loomo/locale/main.dtd"> visual studio doesn't recognize the chrome uri prefix, what will give you an
error at the previous line ("the uri prefix is not recognized").
... as vs doesn't know how the chrome protocol works it can't detect where the dtd file is really located and thus will give you
errors wherever you use the entities that are declared in this file.
...And 2 more matches
Mozilla release FAQ - Archive of obsolete content
for this particular example, you would want to go look at relevant topics stuart cheshire's discussion on latency versus bandwidth internet -- under the covers (by me) the rfc for http the w3's html 4.0 definition building mozilla i get x
error when trying to build mozilla - what's wrong?
...regarding shells, i would like to recommend the following: if you are using unix, use bash-family shells for the build because of the better control over redirection (in case you want to log
errors and messages) if you are using win32, using the default shell cmd.exe (as opposed to 4dos or 4nt) will probably yield better results.
...when i try to use cvs on windows, i get an
error about no home directory you need to set the home environment variable to a valid directory, as cvs was designed with unix in mind, and wants to put a file in your home directory (the password file) i'm on a unix system, and still am having problems building here's a brief guide to common build problems: cc1: invalid option 'foo' cc: no such file or directory 'foo' these are almost always caused ...
...And 2 more matches
2006-10-27 - Archive of obsolete content
gavin responded to tony's posting saying that the log file shows a "no space left on device"
error when trying to link the final executable.
... ./configure --prefix=/export/home/alex/thunderbird --enable-application=browser --disable-tests --disable-debug -disable-auto-deps --disable-freetype2 -enable-official-branding --enable-default-toolkit=gtk2 --enable-optimize=-xo5 --enable-static --disable-shared --enable-xft --enable-svg the build tools that he used to build firefox 2 are listed in his posting along with the
error that he receives when he tries to build it.
...click here to view the
errorthat he receives when trying to update-packaging.
...And 2 more matches
NPN NewStream - Archive of obsolete content
syntax #include <npapi.h> np
error npn_newstream(npp instance, npmimetype type, const char* target, npstream** stream); parameters the function has the following parameters: instance pointer to current plug-in instance.
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the plug-in is not loaded and the function returns an
error code.
...And 2 more matches
NPN_PostURLNotify - Archive of obsolete content
syntax #include <npapi.h> np
error npn_posturlnotify(npp instance, const char* url, const char* target, uint32 len, const char* buf, npbool file, void* notifydata); parameters the function has the following parameters: instance current plug-in instance, specified by the plug-in.
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the plug-in is not loaded and the function returns an
error code.
...And 2 more matches
NPN_RequestRead - Archive of obsolete content
syntax #include <npapi.h> np
error npn_requestread(npstream* stream, npbyterange* rangelist); parameters the function has the following parameters: stream stream of type np_seek from which to read bytes.
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the function returns an
error code.
...And 2 more matches
NPN_SetValue - Archive of obsolete content
syntax #include <npapi.h> np
error npn_setvalue(npp instance, nppvariable variable, void *value); parameters the function has the following parameters: instance pointer to the plugin instance setting the variable.
... returns if successful, the function should return nperr_no_
error.
... if unsuccessful, the function should return the most relevant npapi
error code.
...And 2 more matches
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
if you haven't you can return an
error and the plugin will be ignored.
...np
error np_initialize(npnetscapefuncs* nstable, nppluginfuncs* pluginfuncs) { np
error err = nperr_no_
error; prbool supportsxembed = pr_false; npntoolkittype toolkit = 0; [ code that copies all of the function tables and does ] [ other standard checks ] /* * make sure that the browser supports functionality we care * about.
... */ err = callnpn_getvalueproc(gnetscapefuncs.getvalue, null, npnvsupportsxembedbool, (void *)&supportsxembed); if (err != nperr_no_
error || supportsxembed != pr_true) return nperr_incompatible_version_
error; err = callnpn_getvalueproc(gnetscapefuncs.getvalue, null, npnvtoolkit, (void *)&toolkit); if (err != nperr_no_
error || toolkit != npnvgtk2) return nperr_incompatible_version_
error; [ the rest of initialization ] return err; } as you can see, if the browser says that it doesn't support xembed and doesn't use gtk2 as a toolkit we return an
error.
...And 2 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
as it stands, the code in the client block would throw an
error since the server-side javascript is not within scope.
..., hidden from the browser return "can't see me!"; } function exposed() { // runs on the server, callable from the browser return "exposed to the browser"; } exposed.proxy = true; // tell jaxer this function is ok to be called from the browser </script> <script runat="client" type="text/javascript"> alert( exposed() ); //works like a charm alert( notexposed() ); //produces an object not found
error since it server-side only </script> understanding the concept of operating context in jaxer is central to moving forward with the example application which is what we'll examine next.
...no custom validation libraries for each environment makes for rapid development with less risk for
error.
...And 2 more matches
Implementation Status - Archive of obsolete content
ttributes supported 3.2.2 linking attributes supported 3.2.3 single-node binding attributes supported 3.2.4 node-set binding attributes supported 3.2.5 model item property attributes partial in some cases a loop
error can occur on valid bindings 302168; 3.3.1 model supported 3.3.2 instance partial instance element with two child element does not trigger exception 337302; 3.3.3 submission partial no support for @indent and complex schema validation 278761; 278762; 3.3...
...ect supported 4.4.16 xforms-in-range supported 4.4.17 xforms-out-of-range supported 4.4.18 xforms-scroll-first xforms-scroll-last supported 4.4.19 xforms-submit-done supported 4.5
error indications partial we don't support the xforms-version-exception event, yet 4.5.1 xforms-binding-exception supported 4.5.2 xforms-compute-exception supported 4.5.3 xforms-link-
error partial not yet generated by load.
... 333782; 4.5.4 xforms-link-exception supported 4.5.5 xforms-output-exception unsupported 4.5.6 xforms-submit-
error supported 4.5.7 xforms-version-exception unsupported 4.6 event sequencing supported 4.6.1 for input, secret, textarea, range, or upload controls supported 4.6.2 for output controls supported 4.6.3 for select or select1 controls partial 4.6.4 for trigger controls supported ...
...And 2 more matches
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
ns_imethod getflags(pruint32 *aflags) {*aflags = nsiclassinfo::plugin_object | nsiclassinfo::dom_object; return ns_ok;} ns_imethod getimplementationlanguage(pruint32 *aimplementationlanguage) {*aimplementationlanguage = nsiprogramminglanguage::cplusplus; return ns_ok;} // the rest of the methods can safely return
error codes...
... ns_imethod getinterfaces(pruint32 *count, nsiid * **array) {return ns_
error_not_implemented;} ns_imethod gethelperforlanguage(pruint32 language, nsisupports **_retval) {return ns_
error_not_implemented;} ns_imethod getcontractid(char * *acontractid) {return ns_
error_not_implemented;} ns_imethod getclassdescription(char * *aclassdescription) {return ns_
error_not_implemented;} ns_imethod getclassid(nscid * *aclassid) {return ns_
error_not_implemented;} ns_imethod getclassidnoalloc(nscid *aclassidnoalloc) {return ns_
error_not_implemented;} }; class nsscriptablepeer : public nsitestplugin, public nsclassinfomixin { public: nsscriptablepeer(); ~nsscriptablepeer(); ns_decl_isupports ns_decl_nsitestplugin }; nsscriptablepee...
...npp_getvalue implementation and possible scenario of scriptable object life cycle #include "nsitestplugin.h" np
error npp_new(npmimetype plugintype, npp instance, uint16 mode, int16 argc, char* argn[], char* argv[], npsaveddata* saved) { if(instance == null) return nperr_invalid_instance_
error; // just prime instance->pdata with null for the purpose of this example // it will be assigned to the scriptable interface later to keep its // association with the specific plugin i...
...And 2 more matches
WAI-ARIA basics - Learn web development
form validation and
error alerts first of all, let's revisit the form example we first looked at in our css and javascript accessibility article (read keeping it unobtrusive for a full recap).
... at the end of this section we showed that we have included some aria attributes on the
error message box that displays any validation
errors when you try to submit the form: <div class="
errors" role="alert" aria-relevant="all"> <ul> </ul> </div> role="alert" automatically turns the element it is applied to into a live region, so changes to it are read out; it also semantically identifies it as an alert message (important time/context sensitive information), and represents a better, more accessible way of delivering an alert to a user (modal dialogs like alert() calls have a number of accessibility problems; see popup windows by webaim).
... an aria-relevant value of all instructs the screenreader to read out the contents of the
error list when any changes are made to it — i.e.
...And 2 more matches
Introducing asynchronous JavaScript - Learn web development
that means that the following (pseudocode) wouldn't work: let response = fetch('myimage.png'); let blob = response.blob(); // display your image blob in the ui somehow that's because you don't know how long the image will take to download, so when you come to run the second line it will throw an
error (possibly intermittently, possibly every time) because the response is not yet available.
... the catch() block at the end runs if any of the .then() blocks fail — in a similar way to synchronous try...catch blocks, an
error object is made available inside the catch(), which can be used to report the kind of
error that has occurred.
...
error handling is much better — all
errors are handled by a single .catch() block at the end of the block, rather than being individually handled in each level of the "pyramid".
...And 2 more matches
Getting started with Vue - Learn web development
navigate to "eslint with
error prevention only" and hit enter again.
... this will help us catch common
errors, but not be overly opinionated.
...this will check for
errors when we save a file inside the project.
...And 2 more matches
Links and Resources
online accessibility validators there are now a few available and excellent online accessibility validators which check single webpages according to checkpoints of wcag guidelines and then reports
errors or warnings.
...the accessibility report will contain
errors and warnings for "automatic checkpoints" and "manual checkpoints"; detailed and useful information (line numbers, instances/occurences, textual references to guidelines) will be included for web authors.
... cynthia says™ from hisoftware® company "cynthia says™" is a free online webpage accessibility validation service that identifies accessibility
errors in webpage related to section 508 standards and/or the wcag guidelines.
...And 2 more matches
Debugging JavaScript
this shows any javascript
errors in your app, as well as any logging calls from the console api.
... browser console the browser console lets you see all javascript
errors and logging in the browser, including from firefox code.
... you can also start the browser console when you launch firefox, by launching firefox from the command line and passing --jsconsole as a flag: /path/to/firefox --jsconsole log to the browser console using the standard console api after importing console.jsm: let console = (cu.import("resource://gre/modules/console.jsm", {})).console; console.log("hello from firefox code");
error console this is obsolete and is no longer enabled in firefox by default.
...And 2 more matches
Listening to events on all tabs
it might also be called if an
error occurs during network loading.
... astatus
error status code associated with the state change; this indicates whether or not the request was successful.
... note: astatus may be a success code even for server generated
errors, such as the http 404 file not found
error.
...And 2 more matches
AddonUpdateChecker
ing version, in boolean ignorecompatibility, in string appversion, in string platformversion) updateinfo getnewestcompatibleupdate(in updateinfo updates[], in string appversion, in string platformversion) void checkforupdates(in string id, in string type, in string updatekey, string url, in updatechecklistener listener) constants constant description
error_timeout the update check timed out.
...
error_download_
error there was an
error while downloading the update information.
...
error_parse_
error the update information was malformed in some way.
...And 2 more matches
Mozilla DOM Hacking Guide
user's guide to class info warning: this document has not yet been reviewed by the dom gurus, it might contain some
errors.
... nscomptr<nsidomwindow> window(do_queryinterface(native)); ns_ensure_true(window, ns_
error_unexpected); nscomptr<nsidomlocation> location; rv = window->getlocation(getter_addrefs(location)); ns_ensure_success(rv, rv); // use the dom to get the location object of the window object.
... ns_ensure_success(rv, rv); if (!::js_defineucproperty(cx, obj, ::js_getstringchars(str), ::js_getstringlength(str), v, nsnull, nsnull, 0)) { return ns_
error_failure; } // this js api call defines the "location" property on the window object, its // value being the xpconnect wrapper for the location object.
...And 2 more matches
NSS CERTVerify Log
if you supply the log parameter, nss will continue chain validation after each
error .
...defined in certt.h: /* * this structure is used to keep a log of
errors when verifying * a cert chain.
... this allows multiple
errors to be reported all at * once.
...And 2 more matches
NSS_3.12.2_release_notes.html
new in nss 3.12.2 new functions in the nss shared library: sec_pkcs12addcertorchainandkey (see p12.h) new pkcs11
errors (see secerr.h) sec_
error_pkcs11_general_
error sec_
error_pkcs11_function_failed sec_
error_pkcs11_device_
error bugs fixed the following bugs have been fixed in nss 3.12.2.
... bug 200704: pkcs11: invalid session handle 0 bug 205434: fully implement new libpkix cert verification api from bug 294531 bug 302670: use the installed libz.so where available bug 305693: shlibsign generates pqg for every run bug 311483: exposing includecertchain as a parameter to sec_pkcs12addcertandkey bug 390527: get rid of pkix
errormsg variable in pkix_
error bug 391560: libpkix does not consistently return pkix_validatenode tree that truly represent failure reasons bug 408260: certutil usage doesn't give enough information about trust arguments bug 412311: replace pr_interval_no_wait with pr_interval_no_timeout in client initialization calls bug 423839: add multiple pkcs#11 token password command line option to nss tools.
... bug 444974: crash upon reinsertion of e-identity smartcard bug 447563: modutil -add prints no
error explanation on failure bug 448431: pk11_createmergelog() declaration causes gcc warning when compiling with -wstrict-prototypes bug 449334: pk12util has duplicate options letters bug 449725: signver is still using static libraries.
...And 2 more matches
NSPR functions
pr_cleanup
error reporting nss uses nspr's thread-specific
error code to report
errors.
... call pr_get
error to get the
error code of the last failed nss or nspr function.
... call pr_set
error to set the
error code, which can be retrieved with pr_get
error later.
...And 2 more matches
SpiderMonkey Internals
the compiler attempts no
error recovery; it bails out on the first
error.
...(otherwise, spidermonkey converts primitive values to objects before invoking their methods, per ecma 262-3 §11.2.1.)
error handling spidermonkey has two interdependent
error-handling systems: javascript exceptions (which are not implemented with, or even compatible with, any kind of native c/c++ exception handling) and
error reporting.
... in general, both functions inside spidermonkey and jsapi callback functions signal
errors by calling js_report
error or one of its variants, or js_setpendingexception, and returning js_false or null.
...And 2 more matches
JSExnType
value prototype in javascript jsexn_none an unthrowable
error.
... (lower bound) jsexn_err
error jsexn_internalerr internal
error jsexn_evalerr eval
error jsexn_rangeerr range
error jsexn_referenceerr reference
error jsexn_syntaxerr syntax
error jsexn_typeerr type
error jsexn_urierr uri
error jsexn_limit (upper bound) description these types are part of a js
errorformatstring structure.
... they define which
error to throw in case of a runtime
error.
...And 2 more matches
JS_CompileFunction
used to report filename or url in
error messages.
...used to report the offending line in the file or url if an
error occurs.
...this information is used in
error messages if an
error occurs during compilation.
...And 2 more matches
JS_CompileFunctionForPrincipals
used to report filename or url in
error messages.
...used to report the offending line in the file or url if an
error occurs.
...this information is passed in messages if an
error occurs during compilation.
...And 2 more matches
JS_CompileScriptForPrincipals
used to report filename or url in
error messages.
...used to report the offending line in the file or url if an
error occurs.
...this information is included in
error messages if an
error occurs during compilation.
...And 2 more matches
JS_GetInstancePrivate
args js::callargs * optional argument, used for
error reporting.
... added in spidermonkey 32 argv jsval * optional argument vector, used for
error reporting.
...if you pass a non-null argument vector, argv, to js_getinstanceprivate, and obj is not an instance of clasp, this function reports a class mismatch
error before returning null.
...And 2 more matches
JS_ReportOutOfMemory
reports a memory allocation
error.
... syntax void js_reportoutofmemory(jscontext *cx); void js_reportallocationoverflow(jscontext *cx); // added in spidermonkey 1.8 name type description cx jscontext * the context in which to report the
error.
...when the javascript engine tries to allocate memory and allocation fails, it reports an
error as though by calling this function.
...And 2 more matches
JSAPI reference
ete since jsapi 8 you can also compile javascript code into a function: struct jsfunction js::compilefunction added in spidermonkey 17 js_decompilefunction js_decompilefunctionbody js_compilefunction obsolete since jsapi 36 js_compilefunctionforprincipals obsolete since jsapi 28 js_compileucfunction obsolete since jsapi 36 js_compileucfunctionforprincipals obsolete since jsapi 28
error handling struct js
errorformatstring added in spidermonkey 17 class js
errorreport class js::autosaveexceptionstate added in spidermonkey 31 enum jsexntype added in spidermonkey 17 js_report
error js_reportwarning js_report
errornumber js_report
errornumberuc js_report
errorflagsandnumber js_report
errorflagsandnumberuc js_report
errornumberucarray added in spidermonkey 24 js_reportoutofmem...
...ory js_reportallocationoverflow added in spidermonkey 1.8 js_get
errorreporter js_set
errorreporterobsolete since jsapi 52 js_
errorfromexception js_get
errorprototype jsreport_is_exception jsreport_is_strict jsreport_is_warning jsreport_is_strict_mode_
error the following functions allow c/c++ functions to throw and catch javascript exceptions: js::create
error added in spidermonkey 38 js_isexceptionpending js_getpendingexception js_setpendingexception js_clearpendingexception js_throwstopiteration added in spidermonkey 1.8 js_isstopiteration added in spidermonkey 31 typedef jsexceptionstate js_saveexceptionstate js_restoreexceptionstate js_dropexceptionstate these functions translate
errors into exceptions and vice versa: js_reportpendingexception js_
errorfromexcept...
...ion js_throwreported
error obsolete since jsapi 29 values and types typedef jsval js::value js::value constructors: js::nullvalue added in spidermonkey 24 js::undefinedvalue added in spidermonkey 24 js::booleanvalue added in spidermonkey 24 js::truevalue added in spidermonkey 24 js::falsevalue added in spidermonkey 24 js::numbervalue added in spidermonkey 24 js::int32value added in spidermonkey 24 js::doublevalue added in spidermonkey 24 js::float32value added in spidermonkey 24 js::stringvalue added in spidermonkey 24 js::objectvalue added in spidermonkey 24 js::objectornullvalue added in spidermonkey 24 js::symbolvalue added in spidermonkey 38 js::value constants: js::nullhandlevalue added in spidermonkey 24 js::undefinedhandlevalue added in spidermonkey 24 ...
...And 2 more matches
nsresult
« xpcom api reference the nsresult data type is a strongly-typed enum used to represent a value returned by an xpcom function; these are typically
error or status codes.
... for a list of defined result values, see
error codes returned by mozilla apis.
... because nsresult is strongly typed, code like the following will result in an
error at compile time: bool foo() { ...
...And 2 more matches
jsdIStackFrame
warnings reported as
errors.
...attempting to alter this bit will result in an ns_
error_illegal_value.
...setting or getting this attribute on any other context will throw a ns_
error_no_interface exception.
...And 2 more matches
nsIAccessibleHyperLink
note: renamed from anchors in gecko 1.9 exceptions thrown ns_
error_failure indicates that the accessible is unattached from the accessible tree.
... exceptions thrown ns_
error_failure indicates that the accessible is unattached from the accessible tree.
... exceptions thrown ns_
error_failure indicates that the accessible is unattached from the accessible tree.
...And 2 more matches
nsICryptoHMAC
exceptions thrown ns_
error_not_initialized if init() has not been called.
...to create the key object use for instance: var keyobject = components.classes["@mozilla.org/security/keyobjectfactory;1"] .getservice(components.interfaces.nsikeyobjectfactory) .keyfromstring(components.interfaces.nsikeyobject.hmac, rawkeydata); exceptions thrown ns_
error_invalid_arg if an unsupported algorithm type is passed.
... exceptions thrown ns_
error_not_initialized if init() has not been called.
...And 2 more matches
nsIFeedProgressListener
1.0 66 introduced gecko 1.8 inherits from: nsifeedresultlistener last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void handleentry(in nsifeedentry entry, in nsifeedresult result); void handlefeedatfirstentry(in nsifeedresult result); void handlestartfeed(in nsifeedresult result); void report
error(in astring
errortext, in long linenumber, in boolean bozo); methods handleentry() called after each entry or item is processed.
... report
error() called by the feed processor when a fatal xml parsing
error occurs, or if the document isn't a feed.
... void report
error( in astring
errortext, in long linenumber, in boolean bozo ); parameters
errortext a short description of the
error.
...And 2 more matches
nsIInputStream
exceptions thrown <other-
error> if the stream is closed due to some
error condition.
... exceptions thrown <other-
error> on failure.
... exceptions thrown <other-
error> on failure.
...And 2 more matches
nsIPrintingPrompt
if an embedder implemented service returns any
error code (other than ns_
error_abort) printing will terminate.
... to fly your own dialog you may: implement this service to display at least the print dialog and a print progress dialog or you may implement just one of the dialogs and pass back ns_
error_not_implemented for any of the others.
... for the print dialog: you may stub out this service by having all the methods return ns_
error_not_implemented.
...And 2 more matches
nsIUpdateCheckListener
this object is notified as the check continues, finishes and if it has an
error.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void oncheckcomplete(in nsixmlhttprequest request, [array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); void on
error(in nsixmlhttprequest request, in nsiupdate update); void onprogress(in nsixmlhttprequest request, in unsigned long position, in unsigned long totalsize); methods oncheckcomplete() called when the update check is completed.
... on
error() called when an
error occurs while loading the remote update service file.
...And 2 more matches
nsIXULTemplateQueryProcessor
only fatal
errors should be thrown, or ns_
error_unexpected if generateresults() has already been called.
... exceptions thrown ns_
error_unexpected if generateresults() has already been called.
...exceptions thrown ns_
error_invalid_arg if aquery is invalid.
...And 2 more matches
Int64
exceptions thrown type
error the specified value cannot be converted into a 64-bit integer.
... exceptions thrown type
error one or both of the specified values is not a 64-bit integer (either signed or unsigned).
... exceptions thrown type
error num is not a 64-bit integer object.
...And 2 more matches
StructType
exceptions thrown type
error the name is not a string, or one or more of the fields does not have a defined size.
... range
error the size of the structure, in bytes, cannot be represented both as a size_t and as a javascript number.
... exceptions thrown
error fields are not yet defined.
...And 2 more matches
Mozilla
error codes returned by mozilla apis the following tables list
errors that can occur when calling various mozilla apis.
... each
error is listed by its name and an
error code in parentheses.
... an
error will typically be displayed on the
error console, but can be captured using a try-catch block in javascript.
...And 2 more matches
Browser Console - Firefox Developer Tools
so it logs the same sorts of information as the web console - network requests, javascript, css, and security
errors and warnings, and messages explicitly logged by javascript code.
... browser console logging the browser console logs the same sorts of messages as the web console: http requests warnings and
errors (including javascript, css, security warnings and
errors, and messages explicitly logged by javascript code using the console api).
...here's an example add-on that just logs an
error when the user clicks a widget: widget = require("sdk/widget").widget({ id: "an-
error-happened", label: "
error!", width: 40, content: "
error!", onclick: log
error }); function log
error() { console.
error("something went wrong!"); } if you build this as an xpi file, then open the browser console, then open the xpi file in firefox and install it, you'll see a widget labeled "
error!" in ...
...And 2 more matches
Debugger.Environment - Firefox Developer Tools
spidermonkey creates debugger.environment instances as needed as the debugger inspects stack frames and function objects; calling debugger.environment as a function or constructor raises a type
error exception.
...this allows the code using each debugger instance to place whatever properties it likes on its own debugger.object instances, without worrying about interfering with other debuggers.) if a debugger.environment instance’s referent is not a debuggee environment, then attempting to access its properties (other than inspectable) or call any its methods throws an instance of
error.
...if this is a declarative environment record, this accessor throws a type
error (since declarative environment records have no such object).
...And 2 more matches
AudioNode.disconnect() - Web APIs
if no matching connection is found, an invalidaccess
error exception is thrown.
...if this parameter is out-of-bound, an indexsize
error exception is thrown.
... if this parameter is out-of-bound, an indexsize
error exception is thrown.
...And 2 more matches
Bluetooth.requestDevice() - Web APIs
exceptions type
error the provided options do not makes sense.
... notfound
error there is no bluetooth device that matches the specified options.
... security
error this operation is not permitted in this context due to security concerns.
...And 2 more matches
CSSStyleSheet.insertRule() - Web APIs
if index > cssrulelist.length, the method aborts with an indexsize
error.
... if rule cannot be inserted at index 0 due to some css constraint, the method aborts with a hierarchyrequest
error.
... if more than one rule is given in the rule parameter, the method aborts with a syntax
error.
...And 2 more matches
Element.requestFullscreen() - Web APIs
if permission is denied, the promise is rejected and the element receives a fullscreen
error event instead.
... exceptions rather than throw a traditional exception, the requestfullscreen() procedure announces
error conditions by rejecting the promise it has returned.
... the rejection handler receives one of the following exception values: type
error the type
error exception may be delivered in any of the following situations: the document containing the element isn't fully active; that is, it's not the current active document.
...And 2 more matches
FileReader - Web APIs
properties filereader.
error read only a domexception representing the
error that occurred while reading the file.
... filereader.on
error a handler for the
error event.
... this event is triggered each time the reading operation encounter an
error.
...And 2 more matches
FileSystemFileEntry - Web APIs
inside the success callback, event handlers are set up to handle the
error error and writeend events.
... fileentry.createwriter(function(filewriter) { filewriter.onwriteend = function(e) { console.log('write completed.'); }; filewriter.on
error = function(e) { console.log('write failed: ' + e.tostring()); }; // create a new blob and write it to log.txt.
... var bb = new blobbuilder(); bb.append('meow'); filewriter.write(bb.getblob('text/plain')); },
errorhandler); },
errorhandler); } window.requestfilesystem(window.temporary, 1024*1024, oninitfs,
errorhandler); specifications specification status comment file and directory entries apithe definition of 'filesystemfileentry' in that specification.
...And 2 more matches
HTMLTableElement - Web APIs
when set, if the object doesn't represent a <caption>, a domexception with the hierarchyrequest
error name is thrown.
...when set, if the object doesn't represent a <thead>, a domexception with the hierarchyrequest
error name is thrown.
...when set, if the object doesn't represent a <tfoot>, a domexception with the hierarchyrequest
error name is thrown.
...And 2 more matches
IDBCursor.update() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbcursor's transaction is inactive.
... readonly
error the transaction mode is read only.
... invalidstate
error the cursor was created using idbindex.openkeycursor, is currently being iterated, or has iterated past its end.
...And 2 more matches
IDBDatabase.createObjectStore() - Web APIs
exceptions this method may raise a domexception with a dom
error of one of the following types: exception description invalidstate
error occurs if the method was not called from a versionchange transaction callback.
... transactioninactive
error occurs if a request is made on a source database that doesn't exist (e.g.
... has been deleted or removed.) in firefox previous to version 41, an invalidstate
error was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) constraint
error an object store with the given name (based on case-sensitive comparison) already exists in the connected database.
...And 2 more matches
IDBDatabase.transaction() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstate
error the close() method has previously been called on this idbdatabase instance.
... notfound
error an object store specified in in the storenames parameter has been deleted or removed.
... type
error the value for the mode parameter is invalid.
...And 2 more matches
IDBDatabaseException - Web APIs
attributes attribute type description code unsigned short the most appropriate
error code for the condition.
... message domstring
error message describing the exception raised.
...unless the cause of the
error is corrected, retrying the same operation would result in failure.
...And 2 more matches
IDBObjectStore.delete() - Web APIs
exceptions this method may raise a domexception of the following types: exception description transactioninactive
error this object store's transaction is inactive.
... readonly
error the object store's transaction mode is read-only.
... invalidstate
error the object store has been deleted.
...And 2 more matches
IDBObjectStore.deleteIndex() - Web APIs
return value undefined exceptions this method may raise a domexception of one of the following types: exception description invalidstate
error occurs if the method was not called from a versionchange transaction mode callback.
... transactioninactive
error occurs if the transaction this idbobjectstore belongs to is not active (e.g.
... has been deleted or removed.) in firefox previous to version 41, an invalidstate
error was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) notfound
error occurs if there is no index with the given name (case-sensitive) in the database.
...And 2 more matches
IDBObjectStore.getAll() - Web APIs
if it is lower than 0 or greater than 232-1 a type
error exception will be thrown.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbobjectstore's transaction is inactive.
... data
error the key or key range provided contains an invalid key or is null.
...And 2 more matches
IDBObjectStore.put() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description readonly
error the transaction associated with this operation is in read-only mode.
... transactioninactive
error this idbobjectstore's transaction is inactive.
... data
error any of the following conditions apply: the object store uses in-line keys or has a key generator, and a key parameter was provided.
...And 2 more matches
Basic concepts - Web APIs
they have onsuccess and on
error properties, and you can call addeventlistener() and removeeventlistener() on them.
... they also have readystate, result, and
errorcode properties that tell you the status of the request.
...dom events always have a type property (in indexeddb, it is most commonly set to "success" or "
error").
...And 2 more matches
MediaSource.addSourceBuffer() - Web APIs
exceptions invalidaccess
error the value specified for mimetype is an empty string rather than a valid mime type.
... invalidstate
error the mediasource is not in the "open" readystate.
... notsupported
error the specified mimetype isn't supported by the user agent, or is not compatible with the mime types of other sourcebuffer objects that are already included in the media source's sourcebuffers list.
...And 2 more matches
NDEFWriter.write() - Web APIs
exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: abort
error the write operation was aborted with abortsignal passed in options.
... notallowed
error the permission for this operation was rejected or overwrite is false and there are already records on the tag.
... notsupported
error there is no nfc adapter compatible with web nfc, or the available nfc adapter does not support pushing messages, or connection can not be established.
...And 2 more matches
Payment Request API - Web APIs
consistent
error handling: the browser can check the validity of card numbers, and can tell the user if a card has expired (or is about to expire).
... dictionaries address
errors a dictionary containing strings providing descriptive explanations of any
errors in any paymentaddress entries which have
errors.
... payer
errors a dictionary containing strings providing descriptive explanations of any
errors in related to paymentresponse's email, phone, and name attributes.
...And 2 more matches
RTCPeerConnection.createAnswer() - Web APIs
failurecallback an rtcpeerconnection
errorcallback which will be passed a single domexception object explaining why the request to create an answer failed.
... exceptions notreadable
error the identity provider wasn't able to provide an identity assertion.
... operation
error generation of the sdp failed for some reason; this is a general failure catch-all exception.
...And 2 more matches
RTCPeerConnection.setConfiguration() - Web APIs
exceptions invalidaccess
error one or more of the urls specified in configuration.iceservers is a turn server, but complete login information is not provided (that is, either the rtciceserver.username or rtciceserver.credentials is missing).
... invalidmodification
error the configuration includes changed identity information, but the connection already has identity information specified.
... invalidstate
error the rtcpeerconnection is closed.
...And 2 more matches
A basic 2D WebGL animation example - Web APIs
function buildshaderprogram(shaderinfo) { let program = gl.createprogram(); shaderinfo.foreach(function(desc) { let shader = compileshader(desc.id, desc.type); if (shader) { gl.attachshader(program, shader); } }); gl.linkprogram(program) if (!gl.getprogramparameter(program, gl.link_status)) { console.log("
error linking shader program:"); console.log(gl.getprograminfolog(program)); } return program; } first, gl.createprogram() is called to create a new, empty, glsl program.
... if an
error occurrs while linking the program, the
error message is logged to console.
... function compileshader(id, type) { let code = document.getelementbyid(id).firstchild.nodevalue; let shader = gl.createshader(type); gl.shadersource(shader, code); gl.compileshader(shader); if (!gl.getshaderparameter(shader, gl.compile_status)) { console.log(`
error compiling ${type === gl.vertex_shader ?
...And 2 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
logging
errors a function called loggl
error() is implemented to provide an easily customized way to output logging information for
errors that occur while executing webgl functions.
... function loggl
error(where) { let err = gl.get
error(); if (err) { console.
error(`webgl
error returned by ${where}: ${err}`); } } this takes as its only input a string, where, which is used to indicate what part of the program generated the
error, since similar
errors can have in multiple situations.
...ession = frame.session; let adjustedrefspace = xrreferencespace; let pose = null; animationframerequestid = session.requestanimationframe(drawframe); adjustedrefspace = applyviewercontrols(xrreferencespace); pose = frame.getviewerpose(adjustedrefspace); if (pose) { let gllayer = session.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); loggl
error("bindframebuffer"); gl.clearcolor(0, 0, 0, 1.0); gl.cleardepth(1.0); // clear everything gl.clear(gl.color_buffer_bit | gl.depth_buffer_bit); loggl
error("glclear"); const deltatime = (time - lastframetime) * 0.001; // convert to seconds lastframetime = time; for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.view...
...And 2 more matches
Starting up and shutting down a WebXR session - Web APIs
either way, you need to be prepared for the lack of an xr property and either gracefully handle the
error or provide some form of fallback.
...so a more complete function that starts up and returns a webxr session could look like this: async function createimmersivesession(xr) { try { session = await xr.requestsession("immersive-vr"); return session; } catch(
error) { throw
error; } } this function returns the new xrsession or throws an exception if an
error occurs while creating the session.
... for example, if you need an unbounded reference space, you can specify that as a required feature in order to ensure that the session you get can use unbounded spaces: async function createimmersivesession(xr) { try { session = await xr.requestsession("immersive-vr", { requiredfeatures: [ "unbounded" ] }); return session; } catch(
error) { throw
error; } } on the other hand, if you need aninline session and would prefer a local reference space, you can do this: async function createinlinesession(xr) { try { session = await xr.requestsession("inline", { optionalfeatures: [ "local" ] }); return session; } catch(
error) { throw
error; } } this createinlinesession() function will try to create a...
...And 2 more matches
WritableStreamDefaultWriter.write() - Web APIs
return value a promise, which fulfills with the undefined upon a successful write, or rejects if the write fails or stream becomes
errored before the writing process is initiated.
... exceptions type
error the target stream is not a writable stream, or it does not have an owner.
...nst defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err) => { console.log("chunk
error:", err); }); }); // call ready again to ensure that all chunks are written // before closing the writer.
...And 2 more matches
Using XMLHttpRequest - Web APIs
this includes periodic progress notifications,
error notifications, and so forth.
... load the transfer is complete; all data is now in the response var oreq = new xmlhttprequest(); oreq.addeventlistener("progress", updateprogress); oreq.addeventlistener("load", transfercomplete); oreq.addeventlistener("
error", transferfailed); oreq.addeventlistener("abort", transfercanceled); oreq.open(); // ...
... } else { // unable to compute progress information since the total size is unknown } } function transfercomplete(evt) { console.log("the transfer is complete."); } function transferfailed(evt) { console.log("an
error occurred while transferring the file."); } function transfercanceled(evt) { console.log("the transfer has been canceled by the user."); } lines 3-6 add event listeners for the various events that are sent while performing a data transfer using xmlhttprequest.
...And 2 more matches
Alerts - Accessibility
the problem you have a form — a contact form, for example — that you want to put some accessible
error checking into.
...this notifies the user of the
error, but allows for them continue modifying the form without losing focus (caused by the “onblur” handler in javascript's default ‘alert’ function).
...this method takes three parameters: the id of the input that is to be validated, the term to search for to ensure validity, and the
error message to be inserted into the alert.
...And 2 more matches
spellcheck - HTML: Hypertext Markup Language
the spellcheck global attribute is an enumerated attribute defines whether the element may be checked for spelling
errors.
... it may have the following values: true, which indicates that the element should be, if possible, checked for spelling
errors; false, which indicates that the element should not be checked for spelling
errors.
...this default value may also be inherited, which means that the element content will be checked for spelling
errors only if its nearest ancestor has a spellcheck state of true.
...And 2 more matches
406 Not Acceptable - HTTP
the hypertext transfer protocol (http) 406 not acceptable client
error response code indicates that the server cannot produce a response matching the list of acceptable values defined in the request's proactive content negotiation headers, and that the server is unwilling to supply a default representation.
... proactive content negotiation headers include: accept accept-charset accept-encoding accept-language in practice, this
error is very rarely used.
... instead of responding using this
error code, which would be cryptic for the end user and difficult to fix, servers ignore the relevant header and serve an actual page to the user.
...And 2 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
so the type diagram looks more like this: number string boolean symbol (new in es2015) object function array date regexp null undefined and there are some built-in
error types as well.
... const pi = 3.14; // variable pi is set pi = 1; // will throw an
error because you cannot change a constant variable.
...it can also be used to set and get properties with names that are reserved words: obj.for = 'simon'; // syntax
error, because 'for' is a reserved word obj['for'] = 'simon'; // works fine starting in ecmascript 5, reserved words may be used as object property names "in the buff".
...And 2 more matches
Classes - JavaScript
you first need to declare your class and then access it, otherwise code like the following will throw a reference
error: const p = new rectangle(); // reference
error class rectangle {} class expressions a class expression is another way to define a class.
... strict mode the body of a class is executed in strict mode, i.e., code written here is subject to stricter syntax for increased performance, some otherwise silent
errors will be thrown, and certain keywords are reserved for future versions of ecmascript.
...a syntax
error will be thrown if the class contains more than one occurrence of a constructor method.
...And 2 more matches
Array.from() - JavaScript
polyfill notes: this algorithm is exactly as specified in ecma-262 6th edition (assuming object and type
error have their original values and that callback.call() evaluates to the original value of function.prototype.call()).
...mapfn(kvalue, k) : mapfn.call(t, kvalue, k); } else { a[k] = kvalue; } } k += 1; } if (isiterator) { throw new type
error( 'array.from: provided arraylike or iterator has length more then 2 ** 52 - 1' ); } else { a.length = len; } return a; }; // the length property of the from method is 1.
... if (arraylikeoriterator == null && !isiterator) { throw new type
error( 'array.from requires an array-like object or iterator - not null or undefined' ); } // 4.
...And 2 more matches
Generator.prototype.throw() - JavaScript
the throw() method resumes the execution of a generator by throwing an
error into it and returns an object with two properties done and value.
...for debugging purposes, it is useful to make it an instanceof
error.
... examples using throw() the following example shows a simple generator and an
error that is thrown using the throw method.
...And 2 more matches
Promise.any() - JavaScript
if no promises in the iterable fulfil (if all of the given promises are rejected), then the returned promise is rejected with an aggregate
error, a new subclass of
error that groups together individual
errors.
... rejection if all of the passed-in promises reject, promise.any asynchronously rejects with an aggregate
error object, which extends
error, and contains an
errors property with an array of rejection values.
...ect) => { reject("always fails"); }); const pslow = new promise((resolve, reject) => { settimeout(resolve, 500, "done eventually"); }); const pfast = new promise((resolve, reject) => { settimeout(resolve, 100, "done quick"); }); promise.any([perr, pslow, pfast]).then((value) => { console.log(value); // pfast fulfils first }) // expected output: "done quick" rejections with aggregate
error promise.any() rejects with an aggregate
error if no promise fulfils.
...And 2 more matches
String.prototype.repeat() - JavaScript
exceptions range
error: repeat count must be non-negative.
... range
error: repeat count must be less than infinity and not overflow maximum string size.
...however, you can polyfill string.prototype.repeat() with the following snippet: if (!string.prototype.repeat) { string.prototype.repeat = function(count) { 'use strict'; if (this == null) throw new type
error('can\'t convert ' + this + ' to object'); var str = '' + this; // to convert string to integer.
...And 2 more matches
Lexical grammar - JavaScript
if the digits after the 0b are not 0 or 1, the following syntax
error is thrown: "missing binary digits after 0b".
...if the digits after the 0o are outside the range (01234567), the following syntax
error is thrown: "missing octal digits after 0o".
...if the digits after 0x are outside the range (0123456789abcdef), the following syntax
error is thrown: "identifier starts immediately after numeric literal".
...And 2 more matches
Object initializer - JavaScript
in non-supporting environments, these notations will lead to syntax
errors.
... json.parse() will reject computed property names and an
error will be thrown.
... let a = {x: 1, x: 2} console.log(a) // {x: 2} in ecmascript 5 strict mode code, duplicate property names were considered a syntax
error.
...And 2 more matches
super - JavaScript
class rectangle { constructor(height, width) { this.name = 'rectangle'; this.height = height; this.width = width; } sayname() { console.log('hi, i am a ', this.name + '.'); } get area() { return this.height * this.width; } set area(value) { this._area = value; } } class square extends rectangle { constructor(length) { this.height; // reference
error, super needs to be called first!
...leaving this out will cause a reference
error.
... class rectangle { constructor() {} static lognbsides() { return 'i have 4 sides'; } } class square extends rectangle { constructor() {} static logdescription() { return super.lognbsides() + ' which are all equal'; } } square.logdescription(); // 'i have 4 sides which are all equal' deleting super properties will throw an
error you cannot use the delete operator and super.prop or super[expr] to delete a parent class' property, it will throw a reference
error.
...And 2 more matches
typeof - JavaScript
typeof /s/ === 'function'; // chrome 1-12 non-conform to ecmascript 5.1 typeof /s/ === 'object'; // firefox 5+ conform to ecmascript 5.1
errors before ecmascript 2015, typeof was always guaranteed to return a string for any operand it was supplied with.
...using typeof could never generate an
error.
... but with the addition of block-scoped let and statements/const using typeof on let and const variables (or using typeof on a class) in a block before they are declared will throw a reference
error.
...And 2 more matches
const - JavaScript
// define my_fav as a constant and give it the value 7 const my_fav = 7; // this will throw an
error - uncaught type
error: assignment to constant variable.
... my_fav = 20; // my_fav is 7 console.log('my favorite number is: ' + my_fav); // trying to redeclare a constant throws an
error // uncaught syntax
error: identifier 'my_fav' has already been declared const my_fav = 20; // the name my_fav is reserved for constant above, so this will fail too var my_fav = 20; // this throws an
error too let my_fav = 20; block scoping it's important to note the nature of block scoping.
... if (my_fav === 7) { // this is fine and creates a block scoped my_fav variable // (works equally well with let to declare a block scoped non const variable) let my_fav = 20; // my_fav is now 20 console.log('my favorite number is ' + my_fav); // this gets hoisted into the global context and throws an
error var my_fav = 20; } // my_fav is still 7 console.log('my favorite number is ' + my_fav); const needs to be initialized // throws an
error // uncaught syntax
error: missing initializer in const declaration const foo; const in objects and arrays const also works on objects and arrays.
...And 2 more matches
Autoplay guide for media and Web Audio APIs - Web media technologies
}).catch(
error => { if (
error.name === "notallowed
error") { showplaybutton(videoelem); } else { // handle a load or playback
error } }); } the first thing we do with the result of play() is make sure it's not undefined.
...checking for undefined prevents this code from failing with an
error on older versions of web browsers.
... if the promise returned by play() is resolved without
error, the then() clause is run and can begin whatever needs to be done when autoplay has begun.
...And 2 more matches
OpenSearch description format
troubleshooting tips if there is a mistake in your search plugin xml, you could run into
errors when adding a discovered plugin.
... if the
error message isn't be helpful, the following tips could help you find the problem.
... the xmlns attribute is important — without it you could get the
error message "firefox could not download the search plugin".
...And 2 more matches
Caching compiled WebAssembly modules - WebAssembly
function opendatabase() { return new promise((resolve, reject) => { var request = indexeddb.open(dbname, dbversion); request.on
error = reject.bind(null, '
error opening wasm cache database'); request.onsuccess = () => { resolve(request.result) }; request.onupgradeneeded = event => { var db = request.result; if (db.objectstorenames.contains(storename)) { console.log(`clearing out version ${event.oldversion} wasm cache`); db.deleteobjectstore(storename); } consol...
...it resolves with the stored compiled module, or rejects with an
error.
... function lookupindatabase(db) { return new promise((resolve, reject) => { var store = db.transaction([storename]).objectstore(storename); var request = store.get(url); request.on
error = reject.bind(null, `
error getting wasm module ${url}`); request.onsuccess = event => { if (request.result) resolve(request.result); else reject(`module ${url} was not found in wasm cache`); } }); } storing and instantiating modules next, we define a function storeindatabase() that fires off an async operation to store a given wasm module in a given database.
...And 2 more matches
Classes and Inheritance - Archive of obsolete content
to illustrate this, let's add a member function to the class shape: shape.prototype.draw = function () { throw
error("not yet implemented"); } let shape = shape(2, 3); shape.draw(); // =>
error: not yet implemented inheritance and constructors suppose we want to create a new class, circle, and inherit it from shape.
...consider the following: let circle = circle(2, 3, 5); circle.draw(); // => type
error: circle.draw is not a function this is not quite right.
...consequently, overriding a method is as simple as providing a new definition on the prototype of the subclass: circle.prototype.draw = function (ctx) { ctx.beginpath(); ctx.arc(this.x, this.y, this.radius, 0, 2 * math.pi, false); ctx.fill(); }; with this definition in place, we get: let shape = shape(2, 3); shape.draw(); //
error: not yet implemented let circle = circle(2, 3, 5); circle.draw(); // type
error: ctx is not defined which is the behavior we were aiming for.
...for instance, to define a constructor for a class shape in terms of class, we can write: let shape = class({ initialize: function (x, y) { this.x = x; this.y = y; }, draw: function () { throw new
error("not yet implemented"); } }); the property initialize is special.
/loader - Archive of obsolete content
for example, the sdk uses this feature to provide a global console object: let { loader } = require('toolkit/loader'); let loader = loader({ globals: { console: { log: dump.bind(dump, 'log: '), info: dump.bind(dump, 'info: '), warn: dump.bind(dump, 'warn: '),
error: dump.bind(dump, '
error: ') } } }); be careful not to misuse this feature!
... let manifest = { './main': { 'requirements': { 'panel': 'sdk/panel' } }, 'sdk/panel': { 'requirements': { 'chrome': 'chrome' } } 'chrome': { 'requirements': {} } }; let loader = loader({ resolve: function(id, requirer) { let requirements = manifest[requirer].requirements; if (id in manifest) return requirements[id]; else throw
error('module "' + requirer + '" has no authority to require ' + 'module "' + id + "') } }); thrown exceptions will propagate to the caller of require().
... console: { log: dump.bind(dump, "log: "), info: dump.bind(dump, "info: "), warn: dump.bind(dump, "warn: "),
error: dump.bind(dump, "
error: ") } }, modules: { // expose legacy api via pseudo modules that eventually may be // replaced with a real ones :) "devtools/gcli": cu.import("resource:///modules/gcli.jsm", {}), "net/utils": cu.import("resource:///modules/netutil.jsm", {}) } }); loader instances the loader produces instances that are nothing more than representations of the env...
... let sandbox = sandbox({ name: 'resource:///modules/foo/bar.js', wantxrays: false, prototype: { console: { log: dump.bind(dump, 'log: '), info: dump.bind(dump, 'info: '), warn: dump.bind(dump, 'warn: '),
error: dump.bind(dump, '
error: ') } } }); evaluate() evaluates code in the supplied sandbox.
content/worker - Archive of obsolete content
on
error function functions that will registered as a listener to an '
error' events.
...
error this event allows the content worker to react to an uncaught runtime script
error that occurs in one of the content scripts.
... arguments
error : the event listener is passed a single argument which is an
error object.
...if you try, you'll see this
error:
error: couldn't find the worker to receive this message.
places/history - Archive of obsolete content
usage this module exports a single function, search(), which synchronously returns a placesemitter object which then asynchronously emits data and end or
error events that contain information about the state of the operation.
...the placesemitter inherits from event/target, and emits data,
error, and end.
...
error the
error event is emitted whenever a search could not be completed.
... arguments string : a string indicating the
error that occurred.
platform/xpcom - Archive of obsolete content
if the factory or service is already registered, this function throws components.results.ns_
error_factory_exists.
...if the factory or service isn't registered, this function throws components.results.ns_
error_factory_not_registered.
... if it finds a match, it returns this, otherwise it throws components.results.ns_
error_no_interface.
... parameters outer : null this argument must be null, or the function throws cr.ns_
error_no_aggregation.
Preferences - Archive of obsolete content
if there's a value of the wrong type and the preference is not locked, an ns_
error_unexpected exception is thrown.
... otherwise an ns_
error_unexpected exception is thrown.
...for example: if (prefs.prefhasuservalue("mypref")) { alert(prefs.getcharpref("mypref")); } note that the getcharpref() call may throw
error even if the preference exists, for example if it has a different type.
...https://wiki.mozilla.org/labs/js_modules how to save preferences to save preferences into the default location: var prefservice = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice); prefservice.savepreffile(null); checking for existence of a key if you try to get the value of a nonexistent preference, an
error will be thrown:
error: ns_
error_unexpected: component returned failure code: 0x8000ffff (ns_
error_unexpected) [nsiprefbranch.getcharpref] to avoid such
errors, you should check whether the key exists or not using nsiprefservice.getpreftype(), as shown below: var prefservicebranch = components.classes["@mozilla.org/preferences-service;1"] .getservice(components...
Connecting to Remote Content - Archive of obsolete content
let url = "http://www.example.com/"; let request = components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"] .createinstance(components.interfaces.nsixmlhttprequest); request.onload = function(aevent) { window.alert("response text: " + aevent.target.responsetext); }; request.on
error = function(aevent) { window.alert("
error status: " + aevent.target.status); }; request.open("get", url, true); request.send(null); in this example we demonstrate how to make a xmlhttprequest call in asynchronous mode.
... following initialization, onload and on
error handlers are registered to a callback function to handle the response returned from the remote server.
... request.onload = function(aevent) { let responsexml = aevent.target.responsexml; let rootelement = responsexml.documentelement; if (rootelement && "parse
error" != rootelement.tagname) { let shopelements = rootelement.getelementsbytagname("shop"); let totalelement = rootelement.getelementsbytagname("total")[0]; window.alert(shopelements[1].getelementsbytagname("name")[0].firstchild.nodevalue); // => orange window.alert(totalelement.firstchild.nodevalue); // => 2 } }; using dom functions is good fo...
...make sure you're not telling users everything is ok, or worse, bombarding them with
error messages.
Local Storage - Archive of obsolete content
we recommend that you at least keep an
error log, so that you can request
error data from your users when you encounter problems that are hard to debug.
...any extension that is more complex than a hello world needs some way to log
errors and trace execution without having to fire up a debugger.
... and then logging is done with any of the following methods, depending on the kind of message being logged: this._logger.fatal("this is a fatal message."); this._logger.
error("this is an
error message."); this._logger.warn("this is a warning message."); this._logger.info("this is an info message."); this._logger.config("this is a config message."); this._logger.debug("this is a debug message."); this._logger.trace("this is a trace message."); you can filter the output of the global logger or any specific logger instance by setting the level property.
... note: we recommend that all exception catch blocks include some logging at the
error or warn levels, and in general you should use logging freely in order to have as much information as possible to fix bugs and know what is going on.
XPCOM Objects - Archive of obsolete content
if you want to see the list in your current firefox installation, just run the following code in the
error console: var str = ""; for (var i in components.classes) { str += i + "\n" }; str a run on firefox 3.6.2 with a few extensions installed yields 876 strings.
...the only aspects to take into account are that methods and attributes must have the same names as their idl counterparts, and that the queryinterface method is implemented: queryinterface : function(aiid) { if (!aiid.equals(ci.xsihellocounter) && !aiid.equals(ci.nsisupports)) { throw cr.ns_
error_no_interface; } return this; } the method is very simple, it validates that the caller is requesting a supported interface, otherwise it throws an exception.
...*/ _singletonobj: null, createinstance: function(aouter, aiid) { if (aouter != null) { throw cr.ns_
error_no_aggregation; } // in this case we need a unique instance of the service.
... if (!this._singletonobj) { this._singletonobj = messagecounter; } return this._singletonobj.queryinterface(aiid); } }; if we wanted a class that can be instantiated, instead of a singleton service, the factory would look like this: var counterfactory = { createinstance: function(aouter, aiid) { if (aouter != null) { throw cr.ns_
error_no_aggregation; } return (new counter()).queryinterface(aiid); } }; the instructions on how to build an idl file are included in the section setting up a development environment.
New Security Model for Web Services - Archive of obsolete content
more-complex access lists could be created to try to establish, with finer granularity, which domains are to be accessible or permitted from which other domains, but this requires extensive management which at best is quite
error-prone for the end user and easily opens holes in a firewall that do not directly hurt the user who reconfigured his browser to try to access some external service but hurts the owners of other services behind the firewall.
... any syntax
error in the document will result in the rest of the file to be ignored.
...denies script access in the event of an xml-wellformedness
error, or validation
error, or if the declaration file does not grant access.
... reports
errors (validation, wellformedness, file not found, etc.) to the console via nsiconsoleservice.
Frequently Asked Questions - Archive of obsolete content
why does mozilla show an "xml parsing
error" message instead of svg?
... this is an xml debugging message to help xml authors correct
errors in their xml documents.
... mozilla will show this message when there's an xml well formedness
error in the file it tried to load.
... (it doesn't mean there's an
error in mozilla.) there are many different xml
errors, but the most common one in svg files is "xml parsing
error: prefix not bound to a namespace".
initInstall - Archive of obsolete content
it is an
error to supply a null or empty name.
... returns an integer
error code.
...it is an
error to call any other install methods before calling initinstall.
...err = getlast
error(); if (!err) performinstall(); else cancelinstall(err); ...
performInstall - Archive of obsolete content
returns an integer
error code.
...in some situations the method may return other
errors.
... in a few cases you may get a registry
error.
...err = getlast
error(); if (!err) performinstall(); else cancelinstall(err); ...
Writing to Files - Archive of obsolete content
other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related
error codes.
...in this example, the operations are enclosed in a try-catch block in order to capture any
errors that might occur during the process.
... see file
errors for a list of
errors that might occur.
...in this case, an
error will occur if the file does not exist, which you can capture using a try-catch block.
Archived Mozilla and build documentation - Archive of obsolete content
error console the
error console is a tool available in most mozilla-based applications that is used for reporting
errors in the application chrome and in web pages user opens.
... it reports javascript-related
errors and warnings, css
errors and arbitrary messages from chrome code.
... in firefox, the
error console can be opened from the tools menu or by ctrl-shift-j.
...a xul validator and the
error console are both available to help debug problems.
Gecko Compatibility Handbook - Archive of obsolete content
correct any
errors and replace proprietary code wherever possible.
... upgrade web authoring tool to versions that support the w3 standards and gecko browsers content differs in gecko browsers and internet explorer the javascript console in netscape 6.x and netscape 7.x displays
errors about document.all, document.layers, document.<property> not being defined because of an incorrect browser sniffing, or use of proprietary javascript.
... due to the common nature of this
error, netscape 6.2 began treating css id attributes as case-insensitive in quirks mode only.
... due to the common nature of this
error by web authors, netscape 6.2 began treating css class attributes as case-insensitive in quirks mode only.
2006-11-10 - Archive of obsolete content
reflow branch build failed with vc 7.1 sp1 november 8th: roy received an
error when he tried to reflow a branch build using vc 7.1 sp1.
... when he ran this "make -f client.mk build" command he receive an
error saying "no such file or directory".
... build problem firefox 2.0 on fc3 november 10th: vin downloaded the latest firefox 2 rc3 and tried to build it on fc3 with the following options: ./configure --enable-application=browser --prefix=$prefix --enable-extensions=default,spatialnavigation then he tried running "make" and received the following
error: /usr/bin/ld: testtarray.o(.text+0x2237): unresolvable relocation against symbol `nstarray_base::semptyhdr' /usr/bin/ld: final link failed: nonrepresentable section on output collect2: ld returned 1 exit status gmake[3]: *** [testtarray]
error 1 gmake[3]: leaving directory `/usr/mozilla2/src/mozilla/xpcom/tests' gmake[2]: *** [libs]
error 2 gmake[2]: leaving directory `/usr/mozilla2/src/mozilla...
.../xpcom' gmake[1]: *** [tier_2]
error 2 gmake[1]: leaving directory `/usr/mozilla2/src/mozilla' make: *** [default]
error 2 he is not sure what is wrong with his build, and is asking for help on how to resolve the build
error.
NPN_DestroyStream - Archive of obsolete content
syntax #include <npapi.h> np
error npn_destroystream(npp instance, npstream* stream, np
error reason); parameters the function has the following parameters: instance pointer to current plug-in instance.
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the plug-in is not loaded and the function returns an
error code.
... for possible values, see
error codes.
NPN_GetAuthenticationInfo - Archive of obsolete content
syntax #include <npapi.h> np
error npn_getauthenticationinfo(npp instance, const char *protocol, const char *host, int32_t port, const char *scheme, const char *realm, char **username, uint32_t *ulen, char **password, uint32_t *plen); parameters this function has the following parameters: instance pointer to the current plug-in instance...
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the function returns an
error code.
... for possible values, see
error codes.
NPN_GetURL - Archive of obsolete content
syntax #include <npapi.h> np
error npn_geturl(npp instance, const char* url, const char* target); parameters the function has the following parameters: instance pointer to the current plug-in instance.
...returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the plug-in is not loaded and the function returns an
error code.
... for possible values, see
error codes.
NPN_GetURLNotify - Archive of obsolete content
syntax #include <npapi.h> np
error npn_geturlnotify(npp instance, const char* url, const char* target, void* notifydata); parameters the function has the following parameters: instance pointer to the current plug-in instance.
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the plug-in is not loaded and the function returns an
error code.
... for possible values, see
error codes.
NPN_GetValueForURL - Archive of obsolete content
syntax #include <npapi.h> typedef enum { npnurlvcookie = 501, npnurlvproxy } npnurlvariable; np
error npn_getvalueforurl(npp instance, npnurlvariable variable, const char *url, char **value, uint32_t *len); parameters this function has the following parameters: instance pointer to the current plug-in instance.
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the function returns an
error code.
... for possible values, see
error codes.
NPN_PostURL - Archive of obsolete content
syntax #include <npapi.h> np
error npn_posturl(npp instance, const char *url, const char *target, uint32 len, const char *buf, npbool file); parameters the function has the following parameters: instance pointer to the current plug-in instance.
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the plug-in is not loaded and the function returns an
error code.
... for possible values, see
error codes.
NPN_SetValueForURL - Archive of obsolete content
(while the api theoretically allows the preferred proxy for a given url to be changed, doing so does not have much meaning given how proxies are configured, and is not supported.) syntax #include <npapi.h> typedef enum { npnurlvcookie = 501, npnurlvproxy } npnurlvariable; np
error npn_setvalueforurl(npp instance, npnurlvariable variable, const char *url, const char *value, uint32_t len); parameters this function has the following parameters: instance pointer to the current plug-in instance.
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the function returns an
error code.
... for possible values, see
error codes.
NPP_Destroy - Archive of obsolete content
syntax #include <npapi.h> np
error npp_destroy(npp instance, npsaveddata **save); parameters the function has the following parameters: instance pointer to the plug-in instance to delete.
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the plug-in is not loaded and the function returns an
error code.
... for possible values, see
error codes.
NPP_DestroyStream - Archive of obsolete content
syntax #include <npapi.h> np
error npp_destroystream(npp instance, npstream* stream, npreason reason); parameters the function has the following parameters: instance pointer to current plug-in instance.
... returns if successful, the plug-in should return nperr_no_
error.
... if unsuccessful, the plug-in should return an
error code.
... for possible values, see
error codes.
NPP_GetValue - Archive of obsolete content
syntax #include <npapi.h> np
error npp_getvalue(void *instance, nppvariable variable, void *value); parameters the function has the following parameters: instance pointer to the plugin instance from which the value should come.
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the function returns an
error code.
... for possible values, see
error codes.
NPP_New - Archive of obsolete content
syntax #include <npapi.h> np
error npp_new(npmimetype plugintype, npp instance, uint16 mode, int16 argc, char *argn[], char *argv[], npsaveddata *saved); parameters the function has the following parameters: plugintype pointer to the mime type for new plug-in instance.
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the function returns an
error code.
... for possible values, see
error codes.
NPP_SetValue - Archive of obsolete content
syntax #include <npapi.h> np
error npp_setvalue(void *instance, npnvariable variable, void *value); parameters the function has the following parameters: instance pointer to plugin instance on which to set the variable.
... returns if successful, the function should return nperr_no_
error.
... if unsuccessful, the function should return the most relevant npapi
error code.
... for possible values, see
error codes.
NPP_SetWindow - Archive of obsolete content
syntax #include <npapi.h> np
error npp_setwindow(npp instance, npwindow *window); parameters the function has the following parameters: instance pointer to the current plug-in instance.
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the plug-in is not loaded and the function returns an
error code.
... for possible values, see
error codes.
NP_GetValue - Archive of obsolete content
syntax #include <npapi.h> np
error np_getvalue(void *instance, nppvariable variable, void *value); parameters the function has the following parameters: instance pointer to the current plug-in instance.
... returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the function returns an
error code.
... for possible values, see
error codes.
Using the W3C DOM - Archive of obsolete content
some browsers have non-standard properties, such as internet explorer's document.all[], that are not part of the w3c document object model (dom) standards and may cause javascript
errors in standards-compliant browsers.
....all.id_attribute_value document.all[id_attribute_value] the following form related properties (originally from internet explorer) are not supported in the w3c document object model: formname.inputname.value inputname.value formctrlname document.forms(0) (note: document.forms[0] (using square brackets) uses the dom standard forms collection) scripts that use these properties will throw
errors in most standards-compliant browsers.
...mozilla-based browsers, msie 6+, opera 7+ and other w3c standards-compliant browsers enforce such handling of parsing
error.
... css 1 forward-compatible parsing css 2.1 rules for handling parsing
errors changing an element's text using the dom the text of an element is available as the textcontent or innertext property (some browsers support both).
The HTML5 input types - Learn web development
any other content causes the browser to display an
error when the form is submitted.
... client-side validation as you can see above, email, along with other newer input types, provides built-in client-side
error validation — performed by the browser before the data gets sent to the server.
...to implement different validation behavior, you can use the pattern attribute, and you can also custom the
error messages; we'll talk how to use these features in the client-side form validation article later on.
...the browser will report an
error if no protocol (such as http:) is entered, or if the url is otherwise malformed.
Sending forms through JavaScript - Learn web development
data sent and response loaded.' ); } ); // define what happens in case of
error xhr.addeventlistener( '
error', function(event) { alert( 'oops!
...data sent and response loaded.' ); } ); // define what happens in case of
error xhr.addeventlistener('
error', function( event ) { alert( 'oops!
...window.addeventlistener( "load", function () { function senddata() { const xhr = new xmlhttprequest(); // bind the formdata object and the form element const fd = new formdata( form ); // define what happens on successful data submission xhr.addeventlistener( "load", function(event) { alert( event.target.responsetext ); } ); // define what happens in case of
error xhr.addeventlistener( "
error", function( event ) { alert( 'oops!
...data sent and response loaded.' ); } ); // define what happens in case of
error xhr.addeventlistener( '
error', function( event ) { alert( 'oops!
Introduction to events - Learn web development
an
error occurs.
...these are often used to display information about filling in form fields when they are focused, or displaying an
error message if a form field is filled with an incorrect value.
...ect the submit button, the natural behavior is for the data to be submitted to a specified page on the server for processing, and the browser to be redirected to a "success message" page of some kind (or the same page, if another is not specified.) the trouble comes when the user has not submitted the data correctly — as a developer, you want to prevent the submission to the server and give an
error message saying what's wrong and what needs to be done to put things right.
...if they are, we call the preventdefault() function on the event object — which stops the form submission — and then display an
error message in the paragraph below our form to tell the user what's wrong: const form = document.queryselector('form'); const fname = document.getelementbyid('fname'); const lname = document.getelementbyid('lname'); const para = document.queryselector('p'); form.onsubmit = function(e) { if (fname.value === '' || lname.value === '') { e.preventdefault(); para.textcontent = 'you need to fil...
Solve common problems in your JavaScript code - Learn web development
one of the most common
errors is to declare the function, but not call it anywhere.
... in fact, some browsers (like firefox) will give you an
error message in the developer console if you have code after a return statement.
... debugging javascript what are the basic types of
error?
...also, see other common
errors for a description of common
errors.
Client-side tooling overview - Learn web development
linters linters are tools that check through your code and tell you about any
errors that are present, what
error types they are, and what code lines they are present on.
... often linters can be configured to not only report
errors, but also report any violations of a specified style guide that you team might be using (for example code that is using the wrong number of spaces for indentation, or using template literals rather than regular string literals).
... eslint is the industry standard javascript linter — a highly configurable tool for catching potential syntax
errors and encouraging "best practices" throughout your code.
... code formatters code formatters are somewhat related to linters, except that rather than point out
errors in your code, they usually tend to make sure your code is formatted correctly, according to your style rules, ideally automatically fixing
errors that they find.
Android-specific test suites
android-findbugs ensures that the code avoids common java coding
errors.
... android-lint ensures that the code avoids common android coding
errors.
... android-findbugs ensures that the code avoids common java coding
errors.
... android-lint ensure that the code avoids common android coding
errors.
Chrome registration
each line is parsed individually; if the line is parsable the chrome registry takes the action identified by that line, otherwise the chrome registry ignores that line (and prints a warning message in the runtime
error console).
...if the above example had a packagename of camelcasepackage, you would get an
error message similar to "no chrome registered for chrome://camelcasepackage/path/to/files".
...if not, you would get a message in the
error console that the appversion flag was not recognized.
...nt/pref/preftree.xul chrome://pippki/content/prefoverlay.xul content pippki jar:pippki.jar!/content/pippki/ locale pippki en-us jar:en-us.jar!/locale/pippki/ content global-platform jar:toolkit.jar!/content/global-platform/ platform skin global classic/1.0 jar:classic.jar!/skin/classic/global/ override chrome://global/content/net
error.xhtml jar:embedder.jar!/global/content/net
error.xhtml content inspector jar:inspector.jar!/content/inspector/ instructions supported in bootstrapped add-ons the following instructions are supported in bootstrapped extensions: manifest content locale skin override debugging a chrome manifest file the chrome list extension shows all registered chrome.
Debugging OpenGL
if an opengl
error occurred when executing the call, an
error message is output.
... the moz_gl_debug_abort_on_
error environment variable, if set, causes firefox to abort as soon as an opengl
error occurs.
... this is generally only useful in cases where you know that no
error should occur, since there are cases where perfectly valid webgl code may generate opengl
errors.
... you don't have to define more than one of these; for example, if you set moz_gl_debug_abort_on_
error, the moz_gl_debug setting is assumed.
Deferred
although the reason can be undefined, it is generally an
error object, like in exception handling.
... * generally its an
error object.
... promise(function(resolve, reject) { this.resolve = resolve; this.reject = reject; }.bind(this)); object.freeze(this); } } and use this function as would promise.defer: function funcwithdefer() { var deferred = new deferred(); var promise = deferred.promise; promise.then( function(aval) { console.log('fullfilled - ', aval); }, function(areason) { console.
error('rejected - areason:', areason) } ); //deferred.resolve('aval of resolved'); deferred.reject('reject val'); return promise; } var promise_funcwithdefer = funcwithdefer(); promise_funcwithdefer.then( function(aval) { console.log('fullfilled - promise_funcwithdefer - ', aval); }, function(areason) { var refobj = {name:'promise_funcwithdefer', areason:areason}; conso...
...le.
error('rejected - promise_funcwithdefer - ', refobj); } ).catch( function(acatch) { console.
error('caught - promise_funcwithdefer - ', acatch); throw acatch; } ); ...
Task.jsm
the promise returned by the task either fulfills with the returned value if generator returns or rejects with the thrown
error if the generator throws.
...the promise returned by the task either fulfills with the returned value if generator returns or rejects with the thrown
error if the generator throws.
...mport("resource://gre/modules/osfile.jsm") components.utils.import("resource://gre/modules/task.jsm") task.spawn(function* () { let currentdir = yield os.file.getcurrentdirectory(); let path = os.path.join(currentdir, ".mozconfig"); try { let info = yield os.file.stat(path); console.log("the .mozconfig file is " + info.size + " bytes long."); } catch (ex if ex instanceof os.file.
error && ex.becausenosuchfile) { console.log("you don't have .mozconfig in " + currentdir); } }).then(null, components.utils.report
error); in this example, if the promise returned by os.file.stat is rejected, an exception is thrown inside the task.
... any other unhandled exception that is thrown inside the task is reported by components.utils.report
error.
Mozilla Web Developer FAQ
the css
error handling rules require erroneous parts to be ignored rather than fixed by guessing.
... css parsing
errors are reported to the javascript console.
...when xhtml output has been retrofitted to a content management system that was not designed for xml from the ground up, the system usually ends up discriminating gecko users by serving tag soup labeled as xml to gecko (leading to a parse
error) and serving the same soup labeled as text/html to ie (not leading to a parse
error).
... in older versions of mozilla as well as in old mozilla-based products, there is no pseudo-dtd catalog and the use of externally defined character entities (other than the five pre-defined ones) leads to an xml parsing
error.
javascript.options.strict
javascript warnings are generated when code is executed that doesn't cause a run-time
error, but is non-standard, poorly written, or prone to cause logic
errors.
... example : <html> <head> <title>sample</title> </head> <body> <label id="name">enter you first name</label> <p id ="sample"></p> <script> "use strict" name1= "john" ; // this will cause and an
error as variable not declared .
... var name2= "peter"; document.getelementbyid("sample").innerhtml = name1; </script> </body> </html> possible values and their effects: true: show javascript
errors and warnings.
... false: show javascript
errors only.
PR_GetSpecialFD
gets the file descriptor that represents the standard input, output, or
error stream.
... syntax #include <prio.h> prfiledesc* pr_getspecialfd(prspecialfd id); parameter the function has the following parameter: id a pointer to an enumerator of type prspecialfd, indicating the type of i/o stream desired: pr_standardinput, pr_standardoutput, or pr_standard
error.
...otherwise, pr_getspecialfd returns null and sets the
error to pr_invalid_argument_
error.
... description type prspecialfd is defined as follows: typedef enum prspecialfd{ pr_standardinput, pr_standardoutput, pr_standard
error } prspecialfd; #define pr_stdin pr_getspecialfd(pr_standardinput) #define pr_stdout pr_getspecialfd(pr_standardoutput) #define pr_stderr pr_getspecialfd(pr_standard
error) file descriptors returned by pr_getspecialfd are owned by the runtime and should not be closed by the caller.
PR_OpenSharedMemory
returns pointer to opaque structure prsharedmemory, or null if an
error occurs.
... retrieve the reason for the failure by calling pr_get
error and pr_getos
error.
...when parameter create is (pr_shm_excl | pr_shm_create) and the shared memory already exists, the function returns null with the
error set to pr_file_exists_
error.
...if the shared memory does not exist, null is returned with the
error set to pr_file_not_found_
error.
PR_Writev
if it is, the function will fail and the
error will be set to pr_buffer_overflow_
error.
...the reason for the failure can be obtained by calling pr_get
error.
...note that if pr_writev returns -1, part of the data may have been written before an
error occurred.
... if the timeout parameter is not pr_interval_no_timeout and all the data cannot be written in the specified interval, pr_writev returns -1 with the
error code pr_io_timeout_
error.
NSS_3.12.1_release_notes.html
bug 311432: ecc's ecl_use_fp code (for linux x86) fails pairwise consistency test bug 330622: certutil's usage messages incorrectly document certain options bug 330628: coreconf/linux.mk should _not_ default to x86 but result in an
error if host is not recognized bug 359302: remove the sslsample code from nss source tree bug 372241: need more versatile form of cert_nametoascii bug 390296: nss ignores subject cn even when san contains no dnsname bug 401928: support generalized pkcs#5 v2 pbes bug 403543: pkix: need a way to enable/disable aia cert fetching bug 408847: pkix_ocspchecker_check does not support specified re...
...g of key derivation bug 426886: use const char* in pk11_importcertforkey bug 428103: cert_encodesubjectkeyid is not defined in any public header file bug 429716: debug builds of libpkix unconditionally dump socket traffic to stdout bug 430368: vfychain -t option is undocumented bug 430369: vfychain -o succeeds even if -pp is not specified bug 430399: vfychain -pp crashes bug 430405:
error log is not produced by cert_pkixverifycert bug 430743: update ssltap to understand the tls session ticket extension bug 430859: pkix: policy mapping fails verification with
error invalid arguments bug 430875: document the policy for the order of cipher suites in ssl_implementedciphers.
... bug 430916: add sustaining asserts bug 431805: leak in nssarena_destroy() bug 431929: memory leaks on
error paths in devutil.c bug 432303: replace pkix_pl_memcpy with memcpy bug 433177: fix the gcc compiler warnings in lib/util and lib/freebl bug 433437: vfychain ignores the -a option bug 433594: crash destroying ocsp cert id [[@ cert_destroyocspcertid ] bug 434099: nss relies on unchecked pkcs#11 object attribute values bug 434187: fix the gcc compiler warnings in nss/lib bug 434398: libpkix cannot find issuer cert immediately after checking it with ocsp bug 434808: certutil -b deadlock when importing two or more roots bug 434860: coverity 1150 - dead code in ocsp_createcertid bug 436428: remove unneeded assert from sec_pkcs7encryptlength bug 436430: make nss publi...
...count in pkix_list_appenditem function bug 442618: eliminate dead function cert_certpackagetype bug 443755: extra semicolon in pkm_tlskeyandmacderive makes conditional code unconditional bug 443760: extra semicolon in seqdatabase makes static analysis tool suspicious bug 448323: certutil -k doesn't report the token and slot names for found keys bug 448324: ocsp checker returns incorrect
error code on request with invalid signing cert bug 449146: remove dead libsec function declarations bug 453227: installation of pem-encoded certificate without trailing newline fails documentation for a list of the primary nss documentation pages on mozilla.org, see nss documentation.
NSS 3.52 release notes
bugs fixed in nss 3.52 bug 1633498 - fix unused variable 'getauxval'
error on ios compilation.
... bug 1626751 - fix
error in generation of fuzz32 docker image after updates.
... bug 1625133 - fix implicit declaration of function 'getopt'
error.
... bug 1624402 - fix compilation
error in firefox android.
NSS Sample Code sample2
* this code uses the simplest of the init functions, which does not * require a nss database to exist */ rv = nss_nodb_init("."); if (rv != secsuccess) { fprintf(stderr, "nss initialization failed (err %d)\n", pr_get
error()); goto out; } /* choose mechanism: ckm_des_cbc_pad, ckm_des3_ecb, ckm_des3_cbc.....
...for * des ops, internal slot is typically the best slot */ if (slot == null) { fprintf(stderr, "unable to find security device (err %d)\n", pr_get
error()); goto out; } /* nss passes blobs around as secitems.
...we use pk11_originunwrap * to indicate the key was unwrapped - which is what should be done * normally anyway - using raw keys isn't a good idea */ symkey = pk11_importsymkey(slot, ciphermech, pk11_originunwrap, cka_encrypt, &keyitem, null); if (symkey == null) { fprintf(stderr, "failure to import key into nss (err %d)\n", pr_get
error()); goto out; } /* set up the pkcs11 encryption paramters.
... * when not using cbc mode, ivitem.data and ivitem.len can be 0, or you * can simply pass null for the iv parameter in pk11_paramfromiv func */ ivitem.type = sibuffer; ivitem.data = giv; ivitem.len = sizeof(giv); secparam = pk11_paramfromiv(ciphermech, &ivitem); if (secparam == null) { fprintf(stderr, "failure to set up pkcs11 param (err %d)\n", pr_get
error()); goto out; } /* sample data we'll encrypt and decrypt */ strcpy(data, "encrypt me!"); fprintf(stderr, "clear data: %s\n", data); /* ========================= start section ============================= */ /* if using the the same key and iv over and over, stuff before this */ /* section and after this section needs to be done only once */ /* encrypt data into buf1...
NSS Sample Code sample5
*slot = null; /* initialize nss * you need to explicitly authenticate to the internal token if you use * nss_init insteadf of nss_nodb_init * invoke this after getting the internal token handle * pk11_authenticate(slot, pr_false, null); */ rv = nss_nodb_init("."); if (rv != secsuccess) { fprintf(stderr, "nss initialization failed (err %d)\n", pr_get
error()); goto cleanup; } /* get internal slot */ slot = pk11_getinternalkeyslot(); if (slot == null) { fprintf(stderr, "couldn't find slot (err %d)\n", pr_get
error()); goto cleanup; } rv = atob_convertasciitoitem(&der, pubkstr); if (rv!= secsuccess) { fprintf(stderr, "atob_convertasciitoitem failed %d\n", pr_get
error()); goto cleanup; } spki = seckey_decoded...
...ersubjectpublickeyinfo(&der); secitem_freeitem(&der, pr_false); pubkey = seckey_extractpublickey(spki); if (pubkey == null) { fprintf(stderr, "couldn't extract public key (err %d)\n", pr_get
error()); goto cleanup; } modulus_len = seckey_publickeystrength(pubkey); fprintf(stderr, "public key modulus %d bytes\n", modulus_len); buf1 = (char *)malloc(modulus_len); buf2 = (char *)malloc(modulus_len); /* initialize buf1 */ for (i=0;i<modulus_len;i++) { buf1[i]= (i %26) + 'a'; } buf1[modulus_len-1] = '\0'; fprintf(stderr, "buffer being encrypted = \n%s\n", buf1); /* encrypt buf1, result will be in buf2 */ rv = pk11_pubencryptraw(pubkey, buf2, buf1, modulus_len, null); if (rv != secsuccess) { fprintf(stderr, "encrypt with public key failed (err ...
...%d)\n", pr_get
error()); goto cleanup; } nickname.type = sibuffer; nickname.data = "pvtkeynickname"; nickname.len = strlen("pvtkeynickname"); rv = atob_convertasciitoitem(&der, pvtkstr); if (rv!= secsuccess) { fprintf(stderr, "atob_convertasciitoitem failed %d\n", pr_get
error()); goto cleanup; } /* ku_all includes a lot of different key usages, ku_data_encipherment * is enough for just rsa encryption.
...g (4th) can be null for rsa key - i think it is even * ignored */ pk11_importderprivatekeyinfoandreturnkey(slot, &der, null, null, pr_false, pr_true, ku_all, &pvtkey, null); secitem_freeitem(&der, pr_false); if (pvtkey == null) { fprintf(stderr, "couldn't extract private key (err %d)\n", pr_get
error()); goto cleanup; } /* clear buf1 */ for (i=0;i<modulus_len;i++) { buf1[i]= '\0'; } /* decrypt buf2, result will be in buf1 */ rv = pk11_pubdecryptraw(pvtkey, buf1, &outlen, modulus_len, buf2, modulus_len); if (rv != secsuccess) { fprintf(stderr, "decrypt with private key failed (err %d)\n", pr_get
error()); goto cleanup; ...
NSS Sample Code sample6
*/ rv = nss_initreadwrite("."); if (rv != secsuccess) { fprintf(stderr, "nss initialization failed (err %d)\n", pr_get
error()); exit(1); } /* generate a key with id 1.
... *
error code: token is read-only.
... */ if (slot == null) { fprintf(stderr, "unable to find security device (err %d)\n", pr_get
error()); return; } keyid[0] = id; keyiditem.type = sibuffer; keyiditem.data = (void *)keyid; keyiditem.len = sizeof(keyid[0]); /* note: keysize must be 0 for fixed key-length algorithms like des.
... * since we're using aes in this example, we're specifying * one of the valid keysizes (16, 24, 32) */ key = pk11_tokenkeygen(slot, ciphermech, 0, 32 /*keysize*/, &keyiditem, pr_true, 0); if (key == null) { fprintf(stderr, "pk11_tokenkeygen failed (err %d)\n", pr_get
error()); pk11_freeslot(slot); return; } fprintf(stderr, "key length of generated key is %d\n", pk11_getkeylength(key)); fprintf(stderr, "mechanism of key is %d (asked for %d)\n", pk11_getmechanism(key), ciphermech); pk11_freesymkey(key); key = pk11_findfixedkey(slot, ciphermech, &keyiditem, 0); if (key == null) { fprintf(stderr, "pk11_findfixedkey failed (err %d)\n", pr_get
error()); pk11_freeslot(slo...
EncDecMAC using token object - sample 3
status rv; pk11symkey *key; if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); if (slot) { pk11_freeslot(slot); } return null; } } key = pk11_findfixedkey(slot, mechanism, keybuf, 0); if (!key) { pr_fprintf(pr_stderr, "pk11_findfixedkey failed (err %d)\n", pr_get
error()); pk11_freeslot(slot); return null; } return key; } /* * decrypt and verify mac */ secstatus decryptandverifymac(const char* outfilename, char *encryptedfilename, secitem *citem, secitem *macitem, pk11symkey* ek, pk11symkey* mk, secitem *ivitem, secitem *paditem) { secstatus rv; prfiledesc* infile; prfiledesc* outfile; unsigned char decbuf[64]; unsigned int decbuflen; unsigned char ptext[blocks...
...; if (rv != secsuccess) { pr_fprintf(pr_stderr, "decrypt failure\n"); goto cleanup; } if (decbuflen == 0) break; rv = macupdate(ctxmac, decbuf, decbuflen); if (rv != secsuccess) { goto cleanup; } if (count == filelength) { decbuflen = decbuflen-paddinglength; } /* write the plain text to out file */ temp = pr_write(outfile, decbuf, decbuflen); if (temp != decbuflen) { pr_fprintf(pr_stderr, "write
error\n"); rv = secfailure; break; } /* save last block of ciphertext */ memcpy(iv, decbuf, decbuflen); ivlen = decbuflen; blocknumber++; } if (rv != secsuccess) { goto cleanup; } rv = macfinal(ctxmac, newmac, &newmaclen, sizeof(newmac)); if (rv != secsuccess) { goto cleanup; } if (port_memcmp(macitem->data, newmac, newmaclen) == 0) { rv = secsuccess; } else { pr_fprintf(pr_stderr, "check mac : failure...
...*/ mackey = generatesymkey(slot, ckm_generic_secret_key_gen, 160/8, &mackeyid, pwdata); if (mackey == null) { pr_fprintf(pr_stderr, "generatesymkey for macing returned null.\n"); rv = secfailure; goto cleanup; } /* get the encrypt key cka_id */ rv = gathercka_id(enckey, &encckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "
error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_set
error(pr_end_of_file_
error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if ...
... | pr_truncate | pr_rdwr, 00660); if (!encfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* write to a header file the iv and the cka_ids * identifying the two keys */ ivitem.type = sibuffer; ivitem.data = iv; ivitem.len = blocksize; rv = writetoheaderfile(iv, blocksize, iv, headerfile); if (rv != secsuccess) { pr_fprintf(pr_stderr, "
error writing iv to cipher file - %s\n", headerfilename); goto cleanup; } rv = writetoheaderfile(encckaid.data, encckaid.len, symkey, headerfile); if (rv != secsuccess) { pr_fprintf(pr_stderr, "
error writing aes cka_id to cipher file - %s\n", encryptedfilename); goto cleanup; } rv = writetoheaderfile(macckaid.data, macckaid.len, mackey, headerfile); if (rv != secsuccess) { pr_fprintf(pr_stderr, "
error ...
ssltyp.html
to find out why, call pr_get
error.
...in this case the value returned by pr_get
error is meaningless.
...use pr_get
error to retrieve the
error code.
...use pr_get
error to retrieve the
error code.
Scripting Java
one thing to be careful of is rhino's handling of
errors in specifying java package or class names.
...if that load fails, it assumes that java.myclass is a package name, and no
error is reported: js> java.myclass [javapackage java.myclass] only if you attempt to use this object as a class will an
error be reported.
...for example, if we call overload's method g with two integers we get an
error because neither form of the method is closer to the argument types than the other: js> o.g(3,4) js:"<stdin>", line 2: the choice of java method overload.g matching javascript argument types (number,number) is ambiguous; candidate methods are: class java.lang.string g(java.lang.string,int) class java.lang.string g(int,java.lang.string) see java method overloading and liveconnect 3 for a more pr...
...rhino wraps java exceptions into
error objects with the following properties: javaexception: the original exception thrown by the java method rhinoexception: the exception wrapped by the rhino runtime the instanceof operator can be used to query the type of an exception: try { java.lang.class.forname("nonexistingclass"); } catch (e) { if (e.javaexception instanceof java.lang.classnotfoundexception) { print("class...
Hacking Tips
break on valgrind
errors sometimes, a bug can be reproduced under valgrind but hardly under gdb.
... $ valgrind --smc-check=all-non-file --vex-iropt-register-updates=allregs-at-mem-access --vgdb-
error=0 ./js … this command will tell you how to start gdb as a remote.
... break 'mozilla::dom::canvasrenderingcontext2d::drawwindow(nsglobalwindow&, double, double, double, double, nsastring_internal const&, unsigned int, mozilla::
errorresult&)' cont break 'presshell::renderdocument(nsrect const&, unsigned int, unsigned int, gfxcontext*)' set print object on set $x = <your x value> set $y = <your y value> print &((cairo_image_surface_t*)athebescontext->mdt.mrawptr->msurface).data[$y * ((cairo_image_surface_t*)athebescontext->mdt.mrawptr->msurface).stride + $x * ((cairo_image_surface_t*)athebescontext->mdt.mrawptr->msurface...
...if this is not set, you will have some
error when you will try to write a pid in /sys/fs/cgroup/cpuset/benchmarks/mask/tasks while running cgexec.
Introduction to the JavaScript shell
after following the build documentation and installing the built shell using make install, you can run the shell in interactive mode using the command: js [ if you get " symbol lookup
error: ./js: undefined symbol: pr_setcurrentthreadname" e.g.
...this is a convenient way to quickly check for syntax
errors in your program without actually running it.
... w
error warnings should be treated as
errors.
... throw
error() throws an
error from the js_report
error() function.
JSNative
otherwise it should either report an
error (using e.g.
... js_report
error or js_reportoutofmemory) or raise an exception (using js_setpendingexception), and the callback must return false.
... (returning false without reporting an
error or raising an exception terminates the script with an uncatchable
error.
... see also mxr id search for jsnative js::callargs js_report
error js_reportoutofmemory js_setpendingexception ...
JS_EvaluateScript
used to report filename or url in
error messages.
...used to report the offending line in the file or url if an
error occurs.
...this information is used in messages if an
error occurs during compilation.
... similarly, lineno is used to report the line number of the script or file where an
error occurred during compilation.
JS_EvaluateScriptForPrincipals
used to report filename or url in
error messages.
...used to report the offending line in the file or url if an
error occurs.
...this information is used in messages if an
error occurs during compilation.
... similarly, lineno is used to report the line number of the script or file where an
error occurred during compilation.
JS_GetPropertyAttributes
if no
error occurs, *foundp receives js_true if the specified property is found and js_false if it is not found.
... if an
error occurs, the value left in *foundp is unspecified.
... if an
error occurs, the return value is js_false, and the values left in *attrsp and *foundp are unspecified.
...the return value is js_true (to indicate that no
error occurred).
JS_ReportPendingException
forward the current pending exception in a given jscontext to the current js
errorreporter callback.
... description if an exception is pending in the context cx, js_reportpendingexception converts the exception to a string and reports it to the current
error reporter.
...if no exception is pending, or if a second
error occurs while trying to report the first one, it returns false.
... this function can be used to catch exceptions thrown from scripts and send them to the
error reporter to be logged or ignored.
Redis Tips
in standard node fashion, first return value is
error or null; second return value is result of redis command.
... but some commands only work with numbers (like incr); for these, if your key can't be parsed as a number, it's an
error: redis> set foo pie ok redis> incr foo (
error) err value is not an integer or out of range atomic counters i guess that sounds like geiger counters.
... * * notice: failing an execution of multi is not considered * an
error.
... note also that it's not an
error for a transaction to be aborted, so err will be null in either case.
NS_NewLocalFile
it is an
error to pass a relative filesystem path.
...otherwise, it returns an
error code.
... ns_
error_file_unrecognized_path indicates that the specified path is invalid.
... this
error is returned if a relative file path is passed to ns_newlocalfile.
NS_NewNativeLocalFile
it is an
error to pass a relative filesystem path.
...otherwise, it returns an
error code.
... ns_
error_file_unrecognized_path indicates that the specified path is invalid.
... this
error is returned if a relative file path is passed to ns_newnativelocalfile.
nsIAccessibleHyperText
exceptions thrown ns_
error_failure indicates that the accessible is unattached from the accessible tree.
... ns_
error_invalid_arg the link index is invalid.
... exceptions thrown ns_
error_failure indicates that the accessible is unattached from the accessible tree.
... return value missing description exceptions thrown ns_
error_failure indicates that the accessible is unattached from the accessible tree.
nsIArray
exceptions thrown ns_
error_failure if the array is empty (to make it easy to detect
errors).
... ns_
error_out_of_memory if there is not enough memory to complete the operation.
...exceptions thrown ns_
error_failure if the element was not in the array.
... exceptions thrown ns_
error_illegal_value when index > length-1.
nsICachingChannel
this may return an
error if cacheasfile is false.
... exceptions thrown ns_
error_not_available when there is not offline cache token.
...an
error of ns_
error_document_not_cached will be sent to the listener's onstoprequest if network io is necessary to complete the request.
...an
error of ns_
error_document_not_cached will be sent to the listener's onstoprequest in this case.
nsIComponentManager
exceptions thrown ns_
error_factory_not_registered indicates that the specified class is not registered.
... exceptions thrown ns_
error_factory_not_registered indicates that the specified class is not registered.
... exceptions thrown ns_
error_factory_not_registered indicates that the specified class is not registered.
... exceptions thrown ns_
error_factory_not_registered indicates that the specified class is not registered.
nsIHttpChannelInternal
this may throw an ns_
error_not_available exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsihttpactivityobserver.isactive attribute is false.
...this may throw an ns_
error_not_available exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsihttpactivityobserver.isactive attribute is false.
...this may throw an ns_
error_not_available exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsihttpactivityobserver.isactive attribute is false.
...this may throw an ns_
error_not_available exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsihttpactivityobserver.isactive attribute is false.
nsIMessageBroadcaster
throws ns_
error_not_initialized if the sender is not initialized.
... for example, we will throw ns_
error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up.
... throws ns_
error_failure when the message receiver cannot be found.
... for example, we will throw ns_
error_failure if we try to send a message to a cross-process frame whose process has crashed.
nsIMessageSender
throws ns_
error_not_initialized if the sender is not initialized.
... for example, we will throw ns_
error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up.
... throws ns_
error_failure when the message receiver cannot be found.
... for example, we will throw ns_
error_failure if we try to send a message to a cross-process frame whose process has crashed.
nsIMutableArray
any of these methods may throw ns_
error_out_of_memory when the array must grow to complete the call, but the allocation fails.
... exceptions thrown ns_
error_failure when a weak reference is requested, but the element does not support nsiweakreference.
... exceptions thrown ns_
error_failure when a weak reference is requested, but the element does not support nsiweakreference.
... exceptions thrown ns_
error_failure when a weak reference is requested, but the element does not support nsiweakreference.
nsIResumableChannel
exceptions thrown ns_
error_not_resumable if this load is not resumable.
...during onstartrequest, this channel will have a status of ns_
error_not_resumable if the file cannot be resumed, for example because the server doesn't support this.
... this
error may occur even if startpos is 0, so that the front end can warn the user.
... similarly, the status of this channel during onstartrequest may be ns_
error_entity_changed, which indicates that the entity has changed, as indicated by a changed entityid.
nsIServiceManager
exceptions thrown ns_
error_factory_not_registered indicates that the specified class is not registered.
... exceptions thrown ns_
error_factory_not_registered indicates that the specified class is not registered.
... exceptions thrown ns_
error_service_not_available indicates that the service hasn't been instantiated.
... exceptions thrown ns_
error_service_not_available indicates that the service hasn't been instantiated.
nsISyncMessageSender
throws ns_
error_not_initialized if the sender is not initialized.
... for example, we will throw ns_
error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up.
... throws ns_
error_failure when the message receiver cannot be found.
... for example, we will throw ns_
error_failure if we try to send a message to a cross-process frame whose process has crashed.
nsITaskbarProgress
state_
error 3 display a determinate,
error progress bar.
...the currentvalue and maxvalue parameters are optional and should be supplied when state is one of state_normal, state_
error or state_paused.
... exceptions thrown ns_
error_illegal_value if currentvalue is greater than maxvalue.
... ns_
error_invalid_arg if state is state_no_progress or state_indeterminate, and either currentvalue or maxvalue is not 0.
nsIUpdatePrompt
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void checkforupdates(); void showupdateavailable(in nsiupdate update); void showupdatedownloaded(in nsiupdate update, [optional] in boolean background); void showupdate
error(in nsiupdate update); void showupdatehistory(in nsidomwindow parent); void showupdateinstalled(); methods checkforupdates() presents a user interface that checks for and displays the available updates.
... showupdate
error() displays an
error message telling the user about an update failure, such as a failure to successfully apply a patch.
...void showupdate
error( in nsiupdate update ); parameters update an nsiupdate describing the update that failed to install.
... the nsiupdate object will not be the actual update when the
error occurred during an update check and will instead be an nsiupdate object with the
error information for the update check.
nsIWebContentHandlerRegistrar
otherwise ns_
error_dom_syntax_err will be thrown.
... note: script must execute from same domain as uri or else it will throw permission
error.
... = adomwindow.contentwindow; break; } } } else { //adomwindow is a popup window if (adomwindow.location.hostname == myurihostname) { htmlcontentwindow = adomwindow; break; } } } // this section here is long and daunting, but its just finding a suitable contentwindow if (!htmlcontentwindow) { throw new
error('no suitable content window found, will not reigsterprotocolhandler.
...if the host names do not match, this
error will be thrown in the
error console.
nsIWebProgress
exceptions thrown ns_
error_failure indicates that there is no associated dom window.
... exceptions thrown ns_
error_invalid_arg indicates that alistener was either null or that it does not support weak references.
... ns_
error_failure indicates that alistener was already registered.
... exceptions thrown ns_
error_failure indicates that alistener was not registered.
nsIXULTemplateBuilder
errors throws ns_
error_null_pointer if aresult or aquerynode is null.
...void removeresult( in nsixultemplateresult aresult ); parameters aresult the result to remove
errors throws ns_
error_null_pointer if aresult is null replaceresult() inform the template builder that one result should be replaced with another.
...
errors throws ns_
error_null_pointer if either argument is null, or ns_
error_invalid_arg if the ids don't match resultbindingchanged() informs the template builder that one or more of the optional bindings for a result has changed.
...void resultbindingchanged( in nsixultemplateresult aresult ); parameters aresult the result to change
errors throws ns_
error_null_pointer if aresult is null getresultforid() returns the result for a given id.
XPCOM Interface Reference
derimgirequestinidomutilsjsdistackframemoziasyncfaviconsmoziasynchistorymozicoloranalyzermozijssubscriptloadermozipersonaldictionarymoziplaceinfomoziplacesautocompletemoziregistrymozirepresentativecolorcallbackmozispellcheckingenginemozistorageaggregatefunctionmozistorageasyncstatementmozistoragebindingparamsmozistoragebindingparamsarraymozistoragecompletioncallbackmozistorageconnectionmozistorage
errormozistoragefunctionmozistoragependingstatementmozistorageprogresshandlermozistorageresultsetmozistoragerowmozistorageservicemozistoragestatementmozistoragestatementcallbackmozistoragestatementparamsmozistoragestatementrowmozistoragestatementwrappermozistoragevacuumparticipantmozistoragevaluearraymozitxttohtmlconvmozithirdpartyutilmozivisitinfomozivisitinfocallbackmozivisitstatuscallbacknsiabcardns...
...toragensicrashreporternsicryptohmacnsicryptohashnsicurrentcharsetlistenernsicyclecollectorlistenernsidbchangelistenernsidbfolderinfonsidnslistenernsidnsrecordnsidnsrequestnsidnsservicensidomcanvasrenderingcontext2dnsidomchromewindownsidomclientrectnsidomdesktopnotificationnsidomdesktopnotificationcenternsidomelementnsidomeventnsidomeventgroupnsidomeventlistenernsidomeventtargetnsidomfilensidomfile
errornsidomfileexceptionnsidomfilelistnsidomfilereadernsidomfontfacensidomfontfacelistnsidomgeogeolocationnsidomgeopositionnsidomgeopositionaddressnsidomgeopositioncallbacknsidomgeopositioncoordsnsidomgeoposition
errornsidomgeoposition
errorcallbacknsidomgeopositionoptionsnsidomglobalpropertyinitializernsidomhtmlaudioelementnsidomhtmlformelementnsidomhtmlmediaelementnsidomhtmlsourceelementnsidomhtmltimer...
...nloadhistorynsidownloadmanagernsidownloadmanageruinsidownloadobservernsidownloadprogresslistenernsidownloadernsidragdrophandlernsidragservicensidragsessionnsidroppedlinkhandlernsidroppedlinkitemnsidynamiccontainernsieditornsieditorboxobjectnsieditordocshellnsieditorimesupportnsieditorloggingnsieditormailsupportnsieditorobservernsieditorspellchecknsieffectivetldservicensienumeratornsienvironmentnsi
errorservicensieventlistenerinfonsieventlistenerservicensieventsourcensieventtargetnsiexceptionnsiextensionmanagernsiexternalhelperappservicensiexternalprotocolservicensiexternalurlhandlerservicensiftpchannelnsiftpeventsinknsifactorynsifavicondatacallbacknsifaviconservicensifeednsifeedcontainernsifeedelementbasensifeedentrynsifeedgeneratornsifeedpersonnsifeedprocessornsifeedprogresslistenernsifeedresul...
...romptnsipromptservicensipropertiesnsipropertynsipropertybagnsipropertybag2nsipropertyelementnsiprotocolhandlernsiprotocolproxycallbacknsiprotocolproxyfilternsiprotocolproxyservicensiproxyinfonsipushmessagensipushservicensipushsubscriptionnsiradiointerfacelayernsirandomgeneratornsirequestnsirequestobservernsiresumablechannelnsirunnablensishentrynsishistorynsishistorylistenernsisockssocketinfonsissl
errorlistenernsisslsocketcontrolnsiscreennsiscreenmanagernsiscript
errornsiscript
error2nsiscriptableionsiscriptableinputstreamnsiscriptableunescapehtmlnsiscriptableunicodeconverternsiscrollablensisearchenginensisearchsubmissionnsisecuritycheckedcomponentnsiseekablestreamnsiselectionnsiselection2nsiselection3nsiselectioncontrollernsiselectionimageservicensiselectionprivatensiserversocketnsiserversocketli...
XPCOM reference
rss feeds are implemented by nslocalmailfolder.ns ensure successmacrons ensure truemacrons_abort_if_falsethis was removed in bug 1127201ns_addrefmacrons_assertionmacrons_ensure_arg_pointermacrons_
errorthrows a assertion (ns_assertion) with the text "
error: (
error text)", so writes this text to console (stderr) and to debug logs (nspr logging).
... this macro is meant for critical
errors; like assertions, ns_
errors should not be reachable.ns_if_addrefmacrons_if_releasemacrons_releasemacrons_warningmacronsgetmoduleprocthis function prototype provides the xpcom entry-point into a module.nsiabcard/thunderbird3the nsiabcard interface is used to represent and manipulate cards in the address book.
...prior to gecko 19 (firefox 19 / thunderbird 19 / seamonkey 2.16), this was an integer that simply returned an
error code.
...this causes compile-time
errors to occur when improper values are returned as nsresult values, thereby making it easier to catch many bugs.
Standard OS Libraries
05%28v=vs.85%29.aspx var point = new ctypes.structtype("tagpoint", [ { "x": ctypes.long }, { "y": ctypes.long } ]); /* declare the signature of the function we are going to call */ var getcursorpos = lib.declare('getcursorpos', ctypes.winapi_abi, ctypes.bool, point.ptr ); /* use it like this */ var point = point(); var ret = getcursorpos(point.address()); components.utils.report
error(ret); components.utils.report
error(point); lib.close(); resources for winapi githubgists :: noitidart / search · winapi - winapi js-ctypes snippets that can be copied and pasted to scratchpad com see using com from js-ctypes.
...t rootx = new ctypes.int(); let rooty = new ctypes.int(); let windowx = new ctypes.int(); let windowy = new ctypes.int(); let mask = new ctypes.unsigned_int(); xquerypointer(display, rootwindow, root.address(), child.address(), rootx.address(), rooty.address(), windowx.address(), windowy.address(), mask.address() ); xclosedisplay(display); components.utils.report
error(rootx.value + "," + rooty.value); x11.close(); resources for x11 extended window manager hints githubgists :: noitidart / search · x11 - x11 js-ctypes snippets that can be copied and pasted to scratchpad xcb all the above methods, gdk, gtk, and x11/xlib are meant to be used on the main thread.
... cgeventref); let cftyperef = ctypes.voidptr_t; let cfrelease = corefoundation.declare("cfrelease", ctypes.default_abi, ctypes.void_t, cgeventref); let event = cgeventcreate(null); let cursor = cgeventgetlocation(event); cfrelease(event); components.utils.report
error(cursor); coregraphics.close(); corefoundation.close(); resources for core foundation github :: philikon - osxtypes - javascript modules are auto-generated from the os x header files githubgists :: noitidart / search · corefoundation - corefoundation js-ctypes snippets that can be copied and pasted to scratchpad cocoa see using objective-c from js-ctypes for more info.
...abi, nspoint, id, sel, "..."); // loc = [nsevent mouselocation] let nsevent = objc_getclass("nsevent"); let mouselocation = sel_registername("mouselocation"); let loc = objc_msgsend_nspoint(nsevent, mouselocation); components.utils.report
error(loc); objc.close(); resources for cocoa googlecode :: js-macosx - lightweight bridge for calling cocoa frameworks from mozilla javascript unmht blog :: js-ctypes and objc - blog entries on using objective-c from js-ctypes githubgists :: noitidart / search · objc - objective-c js-ctypes snippets that can be copied and pasted to scratchpad android android runs on java and can be used b...
ArrayType
exceptions thrown type
error type is not a ctype, or type.size is undefined.if the length is specifed but if it is not a valid one,then it is also thrown range
error the size of the resulting array can't be represented as both a size_t and as a javascript number.
... exceptions thrown type
error length is not provided for unsized array, or is provided for sized array.
...this will throw a type
error exception if the value can't be converted.
...if this value isn't a valid javascript number that's also a valid index into the array, a type
error exception is thrown.
CData
this will throw a type
error exception if the value can't be converted.
... if the 8-bit string contains invalid encoded character, a type
error exception is thrown.
... here is a method to read "malformed", it attempts to do readstring on it, if it
errors then it tries to read it in another way, so this is an alternative to readstringreplacemalformed, it is an attempt at readingmalformed function readaschar8thenaschar16(stringptr, known_len, jschar) { // when reading as jschar it assumes max length of 500 // stringptr is either char or jschar, if you know its jschar for sure, pass 2nd arg as true // if known_len is passed, then assu...
...nsole.info('char16_val:', char16_val); return char16_val; } if (!jschar) { try { var char8_val = stringptr.readstring(); console.info('stringptr.readstring():', char8_val); return char8_val; } catch (ex if ex.message.indexof('malformed utf-8 character sequence at offset ') == 0) { console.warn('ex of offset utf8 read
error when trying to do readstring so using alternative method, ex:', ex); return readjscharstring(); } } else { return readjscharstring(); } } ...
ctypes
cast(data, type); ctype functiontype(abi, returntype[, argtype1, ...]); cdata int64(n); string libraryname(name); library open(libspec); ctype pointertype(typespec); ctype structtype(name[, fields]); cdata uint64(n); properties property type description errno number the value of the latest system
error.
... winlast
error number|undefined the value of the latest windows
error.
... similar to getlast
error under windows, available only for windows.
...unsigned_char}, {'fsstyle': ctypes.unsigned_char}, {'breserved': ctypes.unsigned_char}, {'breserved2': ctypes.unsigned_char}, {'breserved3': ctypes.unsigned_char}, {'breserved4': ctypes.unsigned_char}, {'breserved5': ctypes.unsigned_char}, {'breserved6': ctypes.unsigned_char}, {'dwdata': ctypes.uintptr_t}, {'istring': ctypes.intptr_t} ]); } else { throw new
error("wut?!"); } console.log(struct_tbbutton.size); // 20 on 32-bit, 32 on 64-bit if i'm not mistaken there is another way to do this, we can use arraytype, but example for this i don't know at this time.
URLs - Plugins
np
error npn_geturl(npp instance, const char *url, const char *target); the instance parameter represents the current plug-in instance.
... np
error npn_geturlnotify(npp instance, const char* url, const char* target, void* notifydata); the instance, url, and target parameters have the same definitions as those of npn_geturl.
... np
error npn_posturl(npp instance, const char *url, const char *target, uint32 len, const char *buf, npbool file); the instance, url, and target parameters have the same definitions as those of npn_geturl.
... np
error npn_posturlnotify( npp instance, const char *url, const char *target, uint32 len, const char *buf, npbool file, void* notifydata ); the parameters of this function have the same definitions as those of npn_posturl.
Debugger.Object - Firefox Developer Tools
if the referent is not callable, throw a type
error.
...if the referent is not callable, throw a type
error.
...if the referent is not a global object, throw a type
error exception.
...if the referent is not a global object, throw a type
error.
Migrating from Firebug - Firefox Developer Tools
xhr, dom, cookie and
error breakpoints are not supported yet (see bug 821610, bug 1004678, bug 895893 and bug 1165010).
... while there are no breakpoints for single javascript
errors, there is a setting pause on exceptions within the debugger panel options.
... developer toolbar display of
error count when there are javascript
errors on a page, the firebug start button shows a badge with their number.
... the devtools show the number of
errors in the developer toolbar.
AudioNode.connect() - Web APIs
otherwise, a notsupported
error exception is thrown.
... exceptions indexsize
error the value specified as outputindex or inputindex doesn't correspond to an existing input or output.
... invalidaccess
error the destination node is not part of the same audio context as the source node.
... notsupported
error the specified connection would create a cycle (in which the audio loops back through the same nodes repeatedly) and there are no delaynodes in the cycle to prevent the resulting waveform from getting stuck constructing the same audio frame indefinitely.
AudioParam.setValueCurveAtTime() - Web APIs
every value in the array must be a finite number; if any value is nan, infinity, or -infinity, a type
error exception is thrown.
... exceptions invalidstate
error the specified array of values has fewer than 2 items in it.
... range
error the specified starttime is either negative or a non-finite value, or duration is not a finite, strictly positive number.
... type
error one or more of the values in the values array is non-finite.
CustomElementRegistry.define() - Web APIs
exceptions exception description notsupported
error the customelementregistry already contains an entry with the same name or the same constructor (or is otherwise already defined), or extends is specified and it is a valid custom element name, or extends is specified but the element it is trying to extend is an unknown element.
... syntax
error the provided name is not a valid custom element name.
... type
error the referenced constructor is not a constructor.
... note: you'll often get notsupported
errors thrown that seem like define() is failing, but instead it is likely a problem with element.attachshadow().
FileReaderSync.readAsArrayBuffer() - Web APIs
exceptions the following exceptions can be raised by this method: notfound
error is raised when the resource represented by the dom file or blob cannot be found, e.g.
... security
error is raised when one of the following problematic situation is detected: the resource has been modified by a third party; too many read are performed simultaneously; the file pointed by the resource is unsafe for a use from the web (like it is a system file).
... notreadable
error is raised when the resource cannot be read due to a permission problem, like a concurrent lock.
... encoding
error is raised when the resource is a data url and exceed the limit length defined by each browser.
FileReaderSync.readAsBinaryString() - Web APIs
exceptions the following exceptions can be raised by this method: notfound
error is raised when the resource represented by the dom file or blob cannot be found, e.g.
... security
error is raised when one of the following problematic situation is detected: the resource has been modified by a third party; too many read are performed simultaneously; the file pointed by the resource is unsafe for a use from the web (like it is a system file).
... notreadable
error is raised when the resource cannot be read due to a permission problem, like a concurrent lock.
... encoding
error is raised when the resource is a data url and exceed the limit length defined by each browser.
FileReaderSync.readAsDataURL() - Web APIs
exceptions the following exceptions can be raised by this method: notfound
error is raised when the resource represented by the dom file or blob cannot be found, e.g.
... security
error is raised when one of the following problematic situation is detected: the resource has been modified by a third party; too many read are performed simultaneously; the file pointed by the resource is unsafe for a use from the web (like it is a system file).
... notreadable
error is raised when the resource cannot be read due to a permission problem, like a concurrent lock.
... encoding
error is raised when the resource is a data url and exceed the limit length defined by each browser.
FileReaderSync.readAsText() - Web APIs
exceptions the following exceptions can be raised by this method: notfound
error is raised when the resource represented by the dom file or blob cannot be found, e.g.
... security
error is raised when one of the following problematic situation is detected: the resource has been modified by a third party; too many read are performed simultaneously; the file pointed by the resource is unsafe for a use from the web (like it is a system file).
... notreadable
error is raised when the resource cannot be read due to a permission problem, like a concurrent lock.
... encoding
error is raised when the resource is a data url and exceed the limit length defined by each browser.
FileHandle API - Web APIs
// get a lockedfile object from the handle var myfile = myfilehandle.open('readwrite'); // start a writing operation var writing = myfile.append('some content'); writing.onsuccess = function () { console.log('writing operation successful'); } writing.on
error = function () { console.log('something goes wrong in the writing process: ' + this.
error); } reading it's possible to directly write the content of a lockedfile object without using an intermediate file object and a filereader object.
...); getmeta.onsuccess = function () { var size = this.result.size; // the reading operation will start with the byte at index 0 in the file myfile.location = 0; // start a reading operation for the whole file content var reading = myfile.readastext(size); reading.onsuccess = function () { console.log('the content of the file is:'); console.log(this.result); } reading.on
error = function () { console.log('something goes wrong in the reading process: ' + this.
error); } } file snapshot in many cases it can be handy to get a snapshot of the file.
... progress = document.queryselector('progress'); var myfile = myfilehandle.open('readonly'); // let's read a 1gb file var action = myfile.readasarraybuffer(1000000000); action.onprogress = function (event) { if (progress) { progress.value = event.loaded; progress.max = event.total; } } action.onsuccess = function () { console.log('yeah \o/ just read a 1gb file'); } action.on
error = function () { console.log('oups :( unable to read a 1gb file') } file storage when a file handle is created, the associated file only exists as a "temporary file" as long as you hold the filehandle instance.
... // get a lockedfile object from the handle var myfile = myfilehandle.open('readwrite'); // start a writing operation var writing = myfile.append('some content'); writing.onsuccess = function () { console.log('writing operation successful'); var saving = myfile.flush(); saving.onsuccess = function () { console.log('the file has been successfully stored'); } } writing.on
error = function () { console.log('something goes wrong in the writing process: ' + this.
error); } api compatibility why a different api than filewriter?
Geolocation.getCurrentPosition() - Web APIs
syntax navigator.geolocation.getcurrentposition(success[,
error[, [options]]) parameters success a callback function that takes a geolocationposition object as its sole input parameter.
...
error optional an optional callback function that takes a geolocationposition
error object as its sole input parameter.
... timeout: integer (milliseconds) - amount of time before the
error callback is invoked, if 0 it will never invoke.
... enablehighaccuracy: false | true examples var options = { enablehighaccuracy: true, timeout: 5000, maximumage: 0 }; function success(pos) { var crd = pos.coords; console.log('your current position is:'); console.log(`latitude : ${crd.latitude}`); console.log(`longitude: ${crd.longitude}`); console.log(`more or less ${crd.accuracy} meters.`); } function
error(err) { console.warn(`
error(${err.code}): ${err.message}`); } navigator.geolocation.getcurrentposition(success,
error, options); specifications specification status comment geolocation api recommendation initial specification.
Geolocation.watchPosition() - Web APIs
you can also, optionally, specify an
error handling callback function.
... syntax navigator.geolocation.watchposition(success[,
error[, options]]) parameters success a callback function that takes a geolocationposition object as an input parameter.
...
error optional an optional callback function that takes a geolocationposition
error object as an input parameter.
... examples var id, target, options; function success(pos) { var crd = pos.coords; if (target.latitude === crd.latitude && target.longitude === crd.longitude) { console.log('congratulations, you reached the target'); navigator.geolocation.clearwatch(id); } } function
error(err) { console.warn('
error(' + err.code + '): ' + err.message); } target = { latitude : 0, longitude: 0 }; options = { enablehighaccuracy: false, timeout: 5000, maximumage: 0 }; id = navigator.geolocation.watchposition(success,
error, options); specifications specification status comment geolocation apithe definition of 'watchposition()' in that speci...
HTMLObjectElement.setCustomValidity - Web APIs
syntax htmlobjectelement.setcustomvalidity(message); parameters
error the message to use for validity
errors.
... examples in this example, we pass the id of an input element, and set different
error messages depending on whether the value is missing, too low or too high.
...o!'); input.reportvalidity(); } else if (input.rangeunderflow) { input.setcustomvalidity('we need a higher number!'); input.reportvalidity(); } else if (input.rangeoverflow) { input.setcustomvalidity('thats too high!'); input.reportvalidity(); } else { input.setcustomvalidity(''); input.reportvalidity(); } } it's vital to set the message to an empty string if there are no
errors.
... as long as the
error message is not null, the form will not pass validation and will not be submitted.
HTMLScriptElement - Web APIs
if the script is blocked, its element receives an
error event; otherwise, it receives a load event.
...for scripts from other origins, this controls if
error information will be exposed.
... function load
error(o
error) { throw new uri
error("the script " + o
error.target.src + " didn't load correctly."); } function prefixscript(url, onloadfunction) { var newscript = document.createelement("script"); newscript.on
error = load
error; if (onloadfunction) { newscript.onload = onloadfunction; } document.currentscript.parentnode.insertbefore(newscript, document.currentscript); newscript.src = url; } ...
... function load
error(o
error) { throw new uri
error("the script " + o
error.target.src + " didn't load correctly."); } function affixscripttohead(url, onloadfunction) { var newscript = document.createelement("script"); newscript.on
error = load
error; if (onloadfunction) { newscript.onload = onloadfunction; } document.head.appendchild(newscript); newscript.src = url; } sample usage: affixscripttohead("myscript1.js"); affixscripttohead("myscript2.js", function () { alert("the script \"myscript2.js\" has been correctly loaded."); }); specifications specification status comment html living standardthe defin...
Ajax navigation example - Web APIs
"></script> <link rel="stylesheet" href="css/style.css" /> js/ajax_nav.js: "use strict"; const ajaxrequest = new (function () { function closereq () { oloadingbox.parentnode && document.body.removechild(oloadingbox); bisloading = false; } function abortreq () { if (!bisloading) { return; } oreq.abort(); closereq(); } function ajax
error () { alert("unknown
error."); } function ajaxload () { var vmsg, nstatus = this.status; switch (nstatus) { case 200: vmsg = json.parse(this.responsetext); document.title = opageinfo.title = vmsg.page; document.getelementbyid(stargetid).innerhtml = vmsg.content; if (bupdateurl) { ...
... case 2: // successful 2xx console.log("successful code " + vmsg); break; case 3: // redirection 3xx console.log("redirection code " + vmsg); break; */ case 4: /* client
error 4xx */ alert("client
error #" + vmsg); break; case 5: /* server
error 5xx */ alert("server
error #" + vmsg); break; default: /* unknown status */ ajax
error(); } } ...
..."&" + sviewkey + "=" + sviewmode : "").slice(1)).replace(rendqstmark, ""); } function getpage (spage) { if (bisloading) { return; } oreq = new xmlhttprequest(); bisloading = true; oreq.onload = ajaxload; oreq.on
error = ajax
error; if (spage) { opageinfo.url = filterurl(spage, null); } oreq.open("get", filterurl(opageinfo.url, "json"), true); oreq.send(); oloadingbox.parentnode || document.body.appendchild(oloadingbox); } function requestpage (surl) { if (history.pushstate) { bupdateurl = true; getpage(surl); } else { /...
... 422: "unprocessable entity", 423: "locked", 424: "failed dependency", 425: "unassigned", 426: "upgrade required", 427: "unassigned", 428: "precondition required", 429: "too many requests", 430: "unassigned", 431: "request header fields too large", 500: "internal server
error", 501: "not implemented", 502: "bad gateway", 503: "service unavailable", 504: "gateway timeout", 505: "http version not supported", 506: "variant also negotiates (experimental)", 507: "insufficient storage", 508: "loop detected", 509: "unassigned", 510: "not extended", ...
IDBFactory.open() - Web APIs
if an
error occurs while the database connection is being opened, then an
error event is fired on the request object returned from this method.
... exceptions this method may raise a domexception of the following types: exception description type
error the value of version is zero or a negative number or not a number.
... example example of calling open with the current specification's version parameter: var request = window.indexeddb.open("todolist", 4); in the following code snippet, we make a request to open a database, and include handlers for the success and
error cases.
...dow.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, so we don't // need window.mozidb*) // let us open version 4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened // successfully, or not dbopenrequest.on
error = function(event) { note.innerhtml += '<li>
error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable.
IDBIndex.getAll() - Web APIs
if it is lower than 0 or greater than 232-1 a type
error exception will be thrown.
... exceptions this method may raise a domexception of the following types: exception description transactioninactive
error this idbindex's transaction is inactive.
... invalidstate
error the idbindex has been deleted or removed.
... a type
error exception is thrown if the count parameter is not between 0 and 232-1 included.
IDBIndex.getAllKeys() - Web APIs
if it is lower than 0 or greater than 232-1 a type
error exception will be thrown.
... exceptions this method may raise a domexception of the following types: exception description transactioninactive
error this idbindex's transaction is inactive.
... invalidstate
error the idbindex has been deleted or removed.
... a type
error exception is thrown if the count parameter is not between 0 and 232-1 included.
IDBIndex.openCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbindex's transaction is inactive.
... type
error the value for the direction parameter is invalid.
... data
error the key or key range provided contains an invalid key.
... invalidstate
error the idbindex has been deleted or removed.
IDBIndex.openKeyCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbindex's transaction is inactive.
... type
error the value for the direction parameter is invalid.
... data
error the key or key range provided contains an invalid key.
... invalidstate
error the idbindex has been deleted or removed.
IDBObjectStore.get() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbobjectstore's transaction is inactive.
... data
error the key or key range provided contains an invalid key.
... invalidstate
error the idbobjectstore has been deleted or removed.
...data from the database getdata(); }; function getdata() { // open a read/write db transaction, ready for retrieving the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.on
error = function(event) { note.innerhtml += '<li>transaction not opened due to
error: ' + transaction.
error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // make a request to get a record by key from the object store var objectstorerequest = objectstore.get("walk dog"); objectstorerequest.onsuccess = function(event) ...
IDBObjectStore.getAllKeys() - Web APIs
if it is lower than 0 or greater than 232-1 a type
error exception will be thrown.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbobjectstore's transaction is inactive.
... data
error the key or key range provided contains an invalid key or is null.
... invalidstate
error the idbobjectstore has been deleted or removed.
IDBObjectStore.name - Web APIs
invalidstate
error either the object store has been deleted or the current transaction is not an upgrade transaction; you can only rename indexes during upgrade transactions; that is, when the mode is "versionchange".
... transactioninactive
error the current transaction is not active.
... constraint
error an object store is already using the specified name.
...30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.on
error = function(event) { note.innerhtml += '<li>transaction not opened due to
error.
msExtendedCode - Web APIs
in the event of an
error, the media element's
error event will be fired.
... the element's
error property will then contain an msextendedcode read-only property with platform-specific
error code information.
... value type: long; the platform specific
error code.
... example var video1 = object.getelementbyid("video1"); video1.addeventlistener('
error', function () { var
error = video1.
error.msextendedcode; //...
Recording a media element - Web APIs
on handles starting the recording process: function startrecording(stream, lengthinms) { let recorder = new mediarecorder(stream); let data = []; recorder.ondataavailable = event => data.push(event.data); recorder.start(); log(recorder.state + " for " + (lengthinms/1000) + " seconds..."); let stopped = new promise((resolve, reject) => { recorder.onstop = resolve; recorder.on
error = event => reject(event.name); }); let recorded = wait(lengthinms).then( () => recorder.state == "recording" && recorder.stop() ); return promise.all([ stopped, recorded ]) .then(() => data); } startrecording() takes two input parameters: a mediastream to record from and the length in milliseconds of the recording to make.
... lines 9-12 creates a new promise, named stopped, which is resolved when the mediarecorder's onstop event handler is called, and is rejected if its on
error event handler is called.
... the rejection handler receives as input the name of the
error that occurred.
... line 20 the catch() for all the promises outputs the
error to the logging area by calling our log() function.
MediaStream Recording API - Web APIs
if anything goes wrong during recording, an
error event is sent to the mediarecorder.
... you can listen for
error events by setting up a on
error event handler.
... mediarecorder
errorevent the interface that represents
errors thrown by the mediastream recording api.
... its
error property is a domexception that specifies that
error occurred.
Using the Media Capabilities API - Web APIs
handling
errors in our video decoding example, a type
error would be raised if the media configuration passed to the decodinginfo() method was invalid.
... there are a few reasons why an
error might occur, including: the specified type isn't one of the two permtited values: file or media-source the contenttype given is the
error can be due to the type not being one of the two possible values, the contenttype not being a valid codec mime type, or invalid or omitted definitions required in the videoconfiguration.
... navigator.mediacapabilities.decodinginfo(videoconfiguration).then( console.log('it worked') ).catch(
error => console.log('it failed: ' +
error) ); media capabilities live example css li { margin : 1em; } html <form> <p>select your video configuration and find out if this browser supports the codec, and whether decoding will be smooth and power efficient:</p> <ul> <li> <label for="codec">select a codec</label> <select id="codec"> <option>video/webm; codecs=vp8</option> <option>video/webm; codecs=vp9</option> <option>video/mp4; codecs=avc1</option> <option>video/mp4; codecs=avc1.420034</option> <option>video/ogg; codecs=theora</option> <option>invalid</option> </select> </li> <li> <label for="size">select a size</label> <...
...' is ' : ' is not ') + 'power efficient.'; var ul = document.getelementbyid("results") li.innerhtml = content; ul.appendchild(li); }).catch((
error) => { var li = document.createelement('li'), ul = document.getelementbyid("results"); li.innertext = 'codec ' + mc.videoconfiguration.video.contenttype + ' threw an
error: ' +
error; ul.appendchild(li); }); } } document.getelementbyid('tryit').addeventlistener('click', mc.tryit); live result ...
Node.removeChild() - Web APIs
this will also happen if child was in fact a child of element at the time of the call, but was removed by an event handler invoked in the course of trying to remove the element (e.g., blur.)
errors thrown the method throws an exception in 2 different ways: if the child was in fact a child of element and so existing on the dom, but was removed the method throws the following exception: uncaught notfound
error: failed to execute 'removechild' on 'node': the node to be removed is not a child of this node.
... if the child doesn't exist on the dom of the page, the method throws the following exception: uncaught type
error: failed to execute 'removechild' on 'node': parameter 1 is not of type 'node'.
...wawaynode = d.removechild(d_nested); to remove a specified element without having to specify its parent node: let node = document.getelementbyid("nested"); if (node.parentnode) { node.parentnode.removechild(node); } to remove all children from an element: let element = document.getelementbyid("top"); while (element.firstchild) { element.removechild(element.firstchild); } causing a type
error <!--sample html code--> <div id="top"> </div> <script type="text/javascript"> let top = document.getelementbyid("top"); let nested = document.getelementbyid("nested"); // throws uncaught type
error let garbage = top.removechild(nested); </script> causing a notfound
error <!--sample html code--> <div id="top"> <div id="nested"></div> </div> <script type="text/javascript"> let top ...
...= document.getelementbyid("top"); let nested = document.getelementbyid("nested"); // this first call correctly removes the node let garbage = top.removechild(nested); // throws uncaught notfound
error garbage = top.removechild(nested); </script> specifications specification status comment domthe definition of 'node: removechild' in that specification.
PaymentDetailsUpdate - Web APIs
error optional a domstring specifying an
error message to present to the user.
... when calling updatewith(), including
error in the updated data causes the user agent to display the text as a general
error message.
... for address field specific
errors, use shippingaddress
errors.
... shippingaddress
errors optional an address
errors object which includes an
error message for each property of the shipping address that could not be validated.
PaymentRequestUpdateEvent.updateWith() - Web APIs
error optional a domstring specifying an
error message to present to the user.
... when calling updatewith(), including
error in the updated data causes the user agent to display the text as a general
error message.
... for address field specific
errors, use shippingaddress
errors.
... shippingaddress
errors optional an address
errors object which includes an
error message for each property of the shipping address that could not be validated.
PaymentResponse.complete() - Web APIs
if an
error occurs, the promise instead rejects, returning one of the exceptions listed below.
... exceptions abort
error the document in which the payment request is taking place became inactive while the user interface was shown.
... invalidstate
error the payment has already completed, or complete() was called while a request to retry the payment is pending.
...ngify(paymentresponse) }; var serverpaymentrequest = new request('secure/payment/endpoint'); fetch(serverpaymentrequest, fetchoptions).then( response => { if (response.status < 400) { paymentresponse.complete("success"); } else { paymentresponse.complete("fail"); }; }).catch( reason => { paymentresponse.complete("fail"); }); }).catch(function(err) { console.
error("uh oh, something bad happened", err.message); }); specifications specification status comment payment request apithe definition of 'paymentresponse: complete' in that specification.
Pointer Lock API - Web APIs
terlockelement: if(document.pointerlockelement === canvas || document.mozpointerlockelement === canvas) { console.log('the pointer lock status is now locked'); } else { console.log('the pointer lock status is now unlocked'); } the document.exitpointerlock() method is used to exit pointer lock, and like requestpointerlock, works asynchronously using the pointerlockchange and pointerlock
error events, which you'll see more about below.
...'mozpointerlockchange', lockchangealert, false); } function lockchangealert() { if(document.pointerlockelement === canvas || document.mozpointerlockelement === canvas) { console.log('the pointer lock status is now locked'); // do something useful in response } else { console.log('the pointer lock status is now unlocked'); // do something useful in response } } pointerlock
error event when there is an
error caused by calling requestpointerlock() or exitpointerlock(), the pointerlock
error event is dispatched to the document.
... document.addeventlistener('pointerlock
error', lock
error, false); document.addeventlistener('mozpointerlock
error', lock
error, false); function lock
error(e) { alert("pointer lock failed"); } note: until firefox 50 the above events were prefixed with moz in firefox.
...if you lock one iframe, you cannot try to lock another iframe and transfer the target to it; pointer lock will
error out.
RTCDataChannel.send() - Web APIs
data sent before connecting is buffered if possible (or an
error occurs if it's not possible), and is also buffered if sent while the connection is closing or closed.
... exceptions invalidstate
error since the data channel uses a separate transport channel from the media content, it must establish its own connection; if it hasn't finished doing so (that is, its readystate is "connecting"), this
error occurs without sending or buffering the data.
... network
error the specified data would need to be buffered, and there isn't room for it in the buffer.
... type
error the specified data is too large for the other peer to receive.
RTCPeerConnection.addIceCandidate() - Web APIs
exceptions when an
error occurs while attempting to add the ice candidate, the promise returned by this method is rejected, returning one of the
errors below as the name attribute in the specified domexception object passed to the rejection handler.
... type
error the specified candidate's sdpmid and sdpmlineindex are both null.
... invalidstate
error the rtcpeerconnection currently has no remote peer established (remotedescription is null).
... operation
error this can happen for a number of reasons: the value specified for sdpmid is non-null and doesn't match the media description id of any media description included within the remotedescription.
RTCPeerConnection.createDataChannel() - Web APIs
exceptions invalidstate
error the rtcpeerconnection is closed.
... type
error this can happen in a couple of situations: the label and/or protocol string is too long; these cannot be longer than 65,535 bytes (bytes, rather than characters).
... syntax
error values were specified for both the maxpacketlifetime and maxretransmits options.
... operation
error either the specified id is already in use or, if no id was specified, the webrtc layer was unable to automatically generate an id because all ids are in use.
RTCRtpSender.replaceTrack() - Web APIs
exceptions if the returned promise is rejected, one of the following exceptions is provided to the rejection handler: invalidmodification
error replacing the rtcrtpsender's current track with the new one would require negotiation.
... invalidstate
error the track on which this method was called is stopped rather than running.
... type
error the new track's kind doesn't match the original track.
...exact: window.selectedcamera } } }) .then(function(stream) { let videotrack = stream.getvideotracks()[0]; pcs.foreach(function(pc) { var sender = pc.getsenders().find(function(s) { return s.track.kind == videotrack.kind; }); console.log('found sender:', sender); sender.replacetrack(videotrack); }); }) .catch(function(err) { console.
error('
error happens:', err); }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpsender.replacetrack()' in that specification.
Response.type - Web APIs
error: network
error.
... no useful information describing the
error is available.
...this is the type for a response obtained from response.
error().
... note: an "
error" response never really gets exposed to script: such a response to a fetch() would reject the promise.
Using Service Workers - Web APIs
const imgload = (url) => { return new promise((resolve, reject) => { var request = new xmlhttprequest(); request.open('get', url); request.responsetype = 'blob'; request.onload = () => { if (request.status == 200) { resolve(request.response); } else { reject(
error('image didn\'t load successfully;
error code:' + request.statustext)); } }; request.on
error = () => { reject(
error('there was a network
error.')); }; request.send(); }); } we return a new promise using the promise() constructor, which takes as an argument a callback function with resolve and reject parameters.
...n we come to call the imgload() function, we call it with the url to the image we want to load, as we might expect, but the rest of the code is a little different: let body = document.queryselector('body'); let myimage = new image(); imgload('mylittlevader.jpg').then((response) => { var imageurl = window.url.createobjecturl(response); myimage.src = imageurl; body.appendchild(myimage); }, (
error) => { console.log(
error); }); on to the end of the function call, we chain the promise then() method, which contains two functions — the first one is executed when the promise successfully resolves, and the second is called when the promise is rejected.
... in the resolved case, we display the image inside myimage and append it to the body (its argument is the request.response contained inside the promise’s resolve method); in the rejected case we return an
error to the console.
...scope is ' + reg.scope); }).catch((
error) => { // registration failed console.log('registration failed with ' +
error); }); } the outer block performs a feature detection test to make sure service workers are supported before trying to register one.
TextDecoder() - Web APIs
if the value for utflabel is unknown, or is one of the two values leading to a 'replacement' decoding algorithm ( "iso-2022-cn" or "iso-2022-cn-ext"), a domexception with the "type
error" value is thrown.
... "utf-16be" 'utf-16be' "utf-16", "utf-16le" 'utf-16le' "x-user-defined" 'x-user-defined' "iso-2022-cn", "iso-2022-cn-ext" 'replacement' optionsoptional is a textdecoderoptions dictionary with the property: fatal a boolean flag indicating if the textdecoder.decode() method must throw a domexception with the "encoding
error" value when an coding
error is found.
... example var textdecoder1 = new textdecoder("iso-8859-2"); var textdecoder2 = new textdecoder(); var textdecoder3 = new textdecoder("csiso2022kr", {fatal: true}); // allows encoding
error exception to be thrown.
... var textdecoder4 = new textdecoder("iso-2022-cn"); // throw a type
error exception.
WebGLRenderingContext.vertexAttribPointer() - Web APIs
exceptions a gl.invalid_value
error is thrown if offset is negative.
... a gl.invalid_operation
error is thrown if stride and offset are not multiples of the size of the data type.
... a gl.invalid_operation
error is thrown if no webglbuffer is bound to the array_buffer target.
... when using a webgl 2 context, a gl.invalid_operation
error is thrown if this vertex attribute is defined as a integer in the vertex shader (e.g.
Window: unhandledrejection event - Web APIs
this is useful for debugging and for providing fallback
error handling for unexpected situations.
... bubbles no cancelable yes interface promiserejectionevent event handler property onunhandledrejection usage notes allowing the unhandledrejection event to bubble will eventually result in an
error message being output to the console.
... basic
error logging this example simply logs information about the unhandled promise rejection to the console.
... // prevent the default handling (such as outputting the //
error to the console) event.preventdefault(); }); specifications specification status comment html living standardthe definition of 'unhandledrejection' in that specification.
Worker - Web APIs
event handlers abstractworker.on
error an eventlistener called whenever an
errorevent of type
error bubbles through to the worker.
... worker.onmessage
error is an eventhandler representing the code to be called when the message
error event is raised.
... message
error fires when a worker object receives a message that can't be deserialized.
... also available via the onmessage
error property.
WritableStream.WritableStream() - Web APIs
abort(reason) optional this method, also defined by the developer, will be called if the app signals that it wishes to abruptly close the stream and put it in an
errored state.
...nst defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err) => { console.log("chunk
error:", err); }); }); // call ready again to ensure that all chunks are written // before closing the writer.
... defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream
error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += dec...
...oded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink
error:", err); } }, queuingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
WritableStream.getWriter() - Web APIs
exceptions type
error the stream you are trying to create a writer for is not a writablestream.
...nst defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err) => { console.log("chunk
error:", err); }); }); // call ready again to ensure that all chunks are written // before closing the writer.
... defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream
error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += dec...
...oded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink
error:", err); } }, queuingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
WritableStream - Web APIs
methods writablestream.abort() aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an
error state, with any queued writes discarded.
...nst defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err) => { console.log("chunk
error:", err); }); }); // call ready again to ensure that all chunks are written // before closing the writer.
... defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream
error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += dec...
...oded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink
error:", err); } }, queuingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
exceptions type
error the provided stream value is not a writablestream, or it is locked to another writer already.
...nst defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sink."); }) .catch((err) => { console.log("chunk
error:", err); }); }); // call ready again to ensure that all chunks are written // before closing the writer.
... defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream
error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += dec...
...oded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink
error:", err); } }, queuingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
XMLHttpRequest: loadend event - Web APIs
the loadend event is fired when a request has completed, whether successfully (after load) or unsuccessfully (after abort or
error).
... bubbles no cancelable no interface progressevent event handler property onloadend examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr
error" type="button" name="xhr" value="click to start xhr (
error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbutton
error = documen...
...t.queryselector('.xhr.
error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('
error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () =...
...> { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbutton
error.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comment xmlhttprequest living standard ...
XMLHttpRequest - Web APIs
since then, a number of additional event handlers have been implemented in various browsers (onload, on
error, onprogress, etc.).
...
error fired when the request encountered an
error.
... also available via the on
error property.
... loadend fired when a request has completed, whether successfully (after load) or unsuccessfully (after abort or
error).
XMLSerializer.serializeToString() - Web APIs
exceptions type
error the specified rootnode is not a compatible node type.
... invalidstate
error the tree could not be successfully serialized, probably due to issues with the content's compatibility with xml serialization.
... syntax
error a serialization of html was requested but could not succeed due to the content not being well-formed.
... the following types are also permitted as descendants of the root node, in addition to node and attr: documenttype document documentfragment element comment text processinginstruction attr if any other type is encountered, a type
error exception is thrown.
XRSystem: requestSession() - Web APIs
exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: invalidstate
error the requested session mode is immersive-vr but there is already an immersive vr session either currently active or in the process of being set up.
... notsupported
error there is no webxr-compatible device available, or the device does not support the specified sessionmode; this can also be thrown if any of the required options are unsupported.
... security
error permission to enter the specified xr mode is denied.
... xrsession.requestanimationframe(onxranimationframe); }).catch(function(
error) { // "immersive-vr" sessions are not supported console.warn("'immersive-vr' isn't supported, or an
error occurred activating vr!"); }); verifying webxr support and using a button to start vr mode the following example shows how to use both issessionsupported() and requestsession().
overflow - CSS: Cascading Style Sheets
to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipanimation typediscrete formal syntax [ visible | hidden | clip | scroll | auto ]{1,2} examples setting different overflow values for text p { width: 12em; height: 6em; border: dotted; overflow: visible; /* content is not clipped */ } visible (default) sed ut perspiciatis unde omnis iste natus
error sit voluptatem accusantium doloremque laudantium.
... p { overflow: hidden; /* no scrollbars are provided */ } overflow: hidden sed ut perspiciatis unde omnis iste natus
error sit voluptatem accusantium doloremque laudantium.
... p { overflow: scroll; /* always show scrollbars */ } overflow: scroll sed ut perspiciatis unde omnis iste natus
error sit voluptatem accusantium doloremque laudantium.
... p { overflow: auto; /* append scrollbars if necessary */ } overflow: auto sed ut perspiciatis unde omnis iste natus
error sit voluptatem accusantium doloremque laudantium.
Getting Started - Developer guides
be sure to use the exact domain name on all of your pages or you will get a "permission denied"
error when you call open().
... // for example, the response may have a 404 (not found) // or 500 (internal server
error) response code.
...if you do not set header content-type: application/xml, ie will throw a javascript "object expected"
error after the line where you tried to access an xml element.
... in the event of a communication
error (such as the server going down), an exception will be thrown in the onreadystatechange method when accessing the response status.
<input type="date"> - HTML: Hypertext Markup Language
if you use min and max to restrict the available dates (see setting maximum and minimum dates), supporting browsers will display an
error if you try to submit a date that is out of bounds.
... you can also use the required attribute to make filling in the date mandatory — an
error will be displayed if you try to submit an empty date field.
...a field required: <form> <label> choose your preferred party date (required, april 1st to 20th): <input type="date" name="party" min="2017-04-01" max="2017-04-20" required> <span class="validity"></span> </label> <p> <button>submit</button> </p> </form> if you try to submit the form with an incomplete date (or with a date outside the set bounds), the browser displays an
error.
...for example, try viewing the following in a unsupporting browser: <form> <label for="bday">enter your birthday: <input type="date" name="bday" required pattern="\d{4}-\d{2}-\d{2}"> <span class="validity"></span> </label> <p> <button>submit</button> </p> </form> if you submit it, you'll see that the browser displays an
error and highlights the input as invalid if your entry doesn't match the pattern ####-##-## (where # is a digit from 0 to 9).
<input type="email"> - HTML: Hypertext Markup Language
if the text in the input box isn't an e-mail address, you'll get an
error message that looks something like this: if we left things at that, we would at least be validating on legitimate e-mail addresses.
...that's because the title may be displayed or spoken as part of a validation
error message.
... that's why, instead, we specify the string "please provide only a best startup ever corporate e-mail address" by doing that, the resulting full
error message might be something like "the entered text doesn't match the required pattern.
... please provide only a best startup ever corporate e-mail address." note: if you run into trouble while writing your validation regular expressions and they're not working properly, check your browser's console; there may be helpful
error messages there to aid you in solving the problem.
Large-Allocation - HTTP
examples large-allocation: 0 large-allocation: 500 troubleshooting
errors the large-allocation header throws warnings or
error messages when used incorrectly.
...this
error is displayed when loading a document with a large-allocation header with a non-get http method.
... this
error means that the document was not loaded at the top level of an user-opened or noopener-opened tab or window.
...if you are running a non-win32 version of firefox, this
error will appear.
Private class fields - JavaScript
class baseclasswithprivatestaticfield { static #private_static_field static basepublicstaticmethod() { this.#private_static_field = 42 return this.#private_static_field } } class subclass extends baseclasswithprivatestaticfield { } let
error = null try { subclass.basepublicstaticmethod() } catch(e) {
error = e} console.assert(
error instanceof type
error) private instance fields private instance fields are declared with # names (pronounced "hash names"), which are identifiers prefixed with #.
...it is a syntax
error to refer to # names from out of scope.
... class classwithprivatefield { #privatefield constructor() { this.#privatefield = 42 this.#randomfield = 666 // syntax
error } } const instance = new classwithprivatefield() instance.#privatefield === 42 // syntax
error private methods private static methods like their public equivalent, private static methods are called on the class itself, not instances of the class.
...as mentioned above: class base { static #privatestaticmethod() { return 42; } static publicstaticmethod1() { return base.#privatestaticmethod(); } static publicstaticmethod2() { return this.#privatestaticmethod(); } } class derived extends base {} console.log(derived.publicstaticmethod1()); // 42 console.log(derived.publicstaticmethod2()); // type
error private instance methods private instance methods are methods available on class instances whose access is restricted in the same manner as private instance fields.
Warning: 08/09 is not a legal ECMA-262 octal constant - JavaScript
message warning: syntax
error: 08 is not a legal ecma-262 octal constant.
... warning: syntax
error: 09 is not a legal ecma-262 octal constant.
...
error type warning.
... examples invalid octal numbers 08; 09; // syntax
error: 08 is not a legal ecma-262 octal constant // syntax
error: "0"-prefixed octal literals and octal escape sequences // are deprecated valid octal numbers use a leading zero followed by the letter "o"; 0o755; 0o644; ...
Functions - JavaScript
here is an example of an anonymous function expression (the name is not used): var myfunction = function() { statements } it is also possible to provide a name inside the definition in order to create a named function expression: var myfunction = function namedfunction(){ statements } one of the benefits of creating a named function expression is that in case we encountered an
error, the stack trace will contain the name of the function, making it easier to find the origin of the
error.
...attempting to use it outside the function's body results in an
error (or undefined if the function name was previously declared via a var statement).
... for example: var y = function x() {}; alert(x); // throws an
error the function name also appears when the function is serialized via function's tostring method.
...for example, the following would result in an
error: var foo = new function("alert(anonymous);"); foo(); unlike functions defined by function expressions or by the function constructor, a function defined by a function declaration can be used before the function declaration itself.
Array.prototype.reduceRight() - JavaScript
calling reduce or reduceright on an empty array without an initial value creates a type
error.
... if the array is empty and no initialvalue was provided, type
error would be thrown.
... // production steps of ecma-262, edition 5, 15.4.4.22 // reference: http://es5.github.io/#x15.4.4.22 if ('function' !== typeof array.prototype.reduceright) { array.prototype.reduceright = function(callback /*, initialvalue*/) { 'use strict'; if (null === this || 'undefined' === typeof this) { throw new type
error('array.prototype.reduce called on null or undefined'); } if ('function' !== typeof callback) { throw new type
error(callback + ' is not a function'); } var t = object(this), len = t.length >>> 0, k = len - 1, value; if (arguments.length >= 2) { value = arguments[1]; } else { while (k >= 0 && !(k in t)) { k--; } if (k < 0) { thro...
...w new type
error('reduce of empty array with no initial value'); } value = t[k--]; } for (; k >= 0; k--) { if (k in t) { value = callback(value, t[k], k, t); } } return value; }; } examples sum up all values within an array var sum = [0, 1, 2, 3].reduceright(function(a, b) { return a + b; }); // sum is 6 flatten an array of arrays var flattened = [[0, 1], [2, 3], [4, 5]].reduceright(function(a, b) { return a.concat(b); }, []); // flattened is [4, 5, 2, 3, 0, 1] run a list of asynchronous functions with callbacks in series each passing their results to the next const waterfall = (...functions) => (callback, ...args) => functions.reduceright( (composition, fn) => (...results) => fn(composition, ...results), callback )(.
Array.prototype.every() - JavaScript
this algorithm is exactly the one specified in ecma-262, 5th edition, assuming object and type
error have their original values, and that callbackfn.call evaluates to the original value of function.prototype.call.
... if (!array.prototype.every) { array.prototype.every = function(callbackfn, thisarg) { 'use strict'; var t, k; if (this == null) { throw new type
error('this is null or not defined'); } // 1.
...if iscallable(callbackfn) is false, throw a type
error exception.
... if (typeof callbackfn !== 'function' && object.prototype.tostring.call(callbackfn) !== '[object function]') { throw new type
error(); } // 5.
Array.prototype.map() - JavaScript
this algorithm is exactly the one specified in ecma-262, 5th edition, assuming object, type
error, and array have their original values and that callback.call evaluates to the original value of function.prototype.call.
... // production steps of ecma-262, edition 5, 15.4.4.19 // reference: http://es5.github.io/#x15.4.4.19 if (!array.prototype.map) { array.prototype.map = function(callback/*, thisarg*/) { var t, a, k; if (this == null) { throw new type
error('this is null or not defined'); } // 1.
...if iscallable(callback) is false, throw a type
error exception.
... // see: http://es5.github.com/#x9.11 if (typeof callback !== 'function') { throw new type
error(callback + ' is not a function'); } // 5.
JSON.parse() - JavaScript
exceptions throws a syntax
error exception if the string to parse is not valid json.
... walk({ "": j }, "") : j; } // if the text is not json parseable, then a syntax
error is thrown.
... throw new syntax
error("json.parse"); }; } examples using json.parse() json.parse('{}'); // {} json.parse('true'); // true json.parse('"foo"'); // "foo" json.parse('[1, 5, "false"]'); // [1, 5, "false"] json.parse('null'); // null using the reviver parameter if a reviver is specified, the value computed by parsing is transformed before being returned.
...}); // 1 // 2 // 4 // 6 // 5 // 3 // "" json.parse() does not allow trailing commas // both will throw a syntax
error json.parse('[1, 2, 3, 4, ]'); json.parse('{"foo" : 1, }'); json.parse() does not allow single quotes // will throw a syntax
error json.parse("{'foo': 1}"); specifications specification ecmascript (ecma-262)the definition of 'json.parse' in that specification.
JSON - JavaScript
in engines that haven't implemented the proposal, u+2028 line separator and u+2029 paragraph separator are allowed in string literals and property keys in json; but their use in these features in javascript string literals is a syntax
error.
... consider this example where json.parse() parses the string as json and eval executes the string as javascript: let code = '"\u2028\u2029"' json.parse(code) // evaluates to "\u2028\u2029" in all engines eval(code) // throws a syntax
error in old engines other differences include allowing only double-quoted strings and having no provisions for undefined or comments.
... members } members = jsonstring : json or members , jsonstring : json jsonarray = [ ] or [ arrayelements ] arrayelements = json or arrayelements , json insignificant whitespace may be present anywhere except within a jsonnumber (numbers must contain no whitespace) or jsonstring (where it is interpreted as the corresponding character in the string, or would cause an
error).
...any violations of the json syntax, including those pertaining to the differences between javascript and json, cause a syntax
error to be thrown.
Object.prototype.constructor - JavaScript
function type () {} let types = [ new array(), [], new boolean(), true, // remains unchanged new date(), new
error(), new function(), function () {}, math, new number(), 1, // remains unchanged new object(), {}, new regexp(), /(?:)/, new string(), 'test' // remains unchanged ] for (let i = 0; i < types.length; i++) { types[i].constructor = type types[i] = [types[i].constructor, types[i] instanceof type, types[i].tostring()] } console.log(types.join('\n')) ...
... // new array() function type() {},false, // [] function type() {},false,false // new boolean() function boolean() { [native code] },false,true // true function type() {},false,mon sep 01 2014 16:03:49 gmt+0600 // new date() function type() {},false,
error // new
error() function type() {},false,function anonymous() { } // new function() function type() {},false,function () {} // function () {} function type() {},false,[object math] // math function type() {},false,0 // new numbe...
...*/ } function createdconstructor() { parent.call(this) } createdconstructor.prototype = object.create(parent.prototype) createdconstructor.prototype.create = function create() { return new this.constructor() } new createdconstructor().create().create() // type
error undefined is not a function since constructor === parent in the example above the exception will be shown since the constructor links to parent.
...startposition } function child(x, y) { this.position = { x: x, y: y } } child = object.assign(parentwithstatic) child.prototype = object.create(parentwithstatic.prototype) child.prototype.constructor = child child.prototype.getoffsetbyinitialposition = function getoffsetbyinitialposition() { let position = this.position let startposition = this.constructor.getstartposition() //
error undefined is not a function, since the constructor is child return { offsetx: startposition.x - position.x, offsety: startposition.y - position.y } }; for this example we need either to stay parent constructor to continue to work properly or reassign static properties to child's constructor: ...
handler.setPrototypeOf() - JavaScript
interceptions this trap can intercept these operations: object.setprototypeof() reflect.setprototypeof() invariants if the following invariants are violated, the proxy will throw a type
error: if target is not extensible, the prototype parameter must be the same value as object.getprototypeof(target).
... for example, object.setprototypeof() will create and throw a type
error itself.
... const handlerreturnsfalse = { setprototypeof(target, newproto) { return false; } }; const newproto = {}, target = {}; const p1 = new proxy(target, handlerreturnsfalse); object.setprototypeof(p1, newproto); // throws a type
error reflect.setprototypeof(p1, newproto); // returns false approach 2: throwing an exception the latter approach will cause any operation that attempts to mutate, to throw.
... const handlerthrows = { setprototypeof(target, newproto) { throw new
error('custom
error'); } }; const newproto = {}, target = {}; const p2 = new proxy(target, handlerthrows); object.setprototypeof(p2, newproto); // throws new
error("custom
error") reflect.setprototypeof(p2, newproto); // throws new
error("custom
error") specifications specification ecmascript (ecma-262)the definition of '[[setprototypeof]]' in that specification.
String.fromCodePoint() - JavaScript
exceptions a range
error is thrown if an invalid unicode code point is given (e.g.
... "range
error: nan is not a valid code point").
...x !== len; ++index) { var codepoint = +arguments[index]; // correctly handles all cases including `nan`, `-infinity`, `+infinity` // the surrounding `!(...)` is required to correctly handle `nan` cases // the (codepoint>>>0) === codepoint clause handles decimals and negatives if (!(codepoint < 0x10ffff && (codepoint>>>0) === codepoint)) throw range
error("invalid code point: " + codepoint); if (codepoint <= 0xffff) { // bmp code point codelen = codeunits.push(codepoint); } else { // astral code point; split in surrogate halves // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae codepoint -= 0x10000; codelen = codeunits.push( (codepoint >> 10) + 0xd800, // hi...
...ng fromcodepoint() valid input: string.fromcodepoint(42); // "*" string.fromcodepoint(65, 90); // "az" string.fromcodepoint(0x404); // "\u0404" == "Є" string.fromcodepoint(0x2f804); // "\ud87e\udc04" string.fromcodepoint(194564); // "\ud87e\udc04" string.fromcodepoint(0x1d306, 0x61, 0x1d307); // "\ud834\udf06a\ud834\udf07" invalid input: string.fromcodepoint('_'); // range
error string.fromcodepoint(infinity); // range
error string.fromcodepoint(-1); // range
error string.fromcodepoint(3.14); // range
error string.fromcodepoint(3e-2); // range
error string.fromcodepoint(nan); // range
error compared to fromcharcode() string.fromcharcode() cannot return supplementary characters (i.e.
Standard built-in objects - JavaScript
object function boolean symbol
error objects
error objects are a special type of fundamental object.
... they include the basic
error type, as well as several specialized
error types.
...
error aggregate
error eval
error internal
error range
error reference
error syntax
error type
error uri
error numbers and dates these are the base objects representing numbers, dates, and mathematical calculations.
... intl intl.collator intl.datetimeformat intl.listformat intl.numberformat intl.pluralrules intl.relativetimeformat intl.locale webassembly webassembly webassembly.module webassembly.instance webassembly.memory webassembly.table webassembly.compile
error webassembly.link
error webassembly.runtime
error other arguments ...
class - JavaScript
but unlike a class expression, a class declaration doesn't allow an existing class to be declared again and will throw a syntax
error if attempted.
... class polygon { constructor(height, width) { this.name = 'polygon'; this.height = height; this.width = width; } } class square extends polygon { constructor(length) { super(length, length); this.name = 'square'; } } attempting to declare a class twice re-declaring a class using the class declaration throws a syntax
error.
... class foo {}; class foo {}; // uncaught syntax
error: identifier 'foo' has already been declared the same
error is thrown when a class has been defined before using the class expression.
... let foo = class {}; class foo {}; // uncaught syntax
error: identifier 'foo' has already been declared specifications specification ecmascript (ecma-262)the definition of 'class definitions' in that specification.
MathML documentation index - MathML
13 <m
error> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <m
error> element is used to display contents as
error messages.
... in firefox this
error message is rendered similar to the typical xml
error message.
... note that this
error is not thrown when your mathml markup is wrong or not well-formed xml.
... you will still get an xml parsing
error (in case of the xhtml notation of mathml), which has nothing to do with <m
error>.
Namespaces crash course - SVG: Scalable Vector Graphics
note that it is an xml
error to use a prefix that hasn't been bound to a namespace name.
... the binding created by the xmlns:xlink parameter in the example above is absolutely essential for the xlink:href parameter to not cause an
error.
...if you don't, user agents such as firefox won't recognize your content and will simply show the xml markup or inform the user that there's an
error in the xml.
...it may save you from some annoying
errors if you end up adding content from one of the unused namespaces at a later date.
event/core - Archive of obsolete content
all the exceptions that are thrown by listeners during the emit are caught and can be handled by listeners of '
error' event.
... thrown exceptions are passed as an argument to an '
error' event listener.
... if no '
error' listener is registered exception will be logged into an
error console.
event/target - Archive of obsolete content
rget.on('message', function onmessage(message) { console.log('listener triggered'); target.on('message', function() { console.log('nested listener triggered'); }); }); emit(target, 'message'); // info: 'listener triggered' emit(target, 'message'); // info: 'listener triggered' // info: 'nested listener triggered' exceptions in the listeners can be handled via '
error' event listeners: target.on('boom', function() { throw
error('boom!'); }); target.once('
error', function(
error) { console.log('caught an
error: ' +
error.message); }); emit(target, 'boom'); // info: caught an
error: boom!
... if there is no listener registered for
error event or if it also throws exception then such exceptions are logged into a console.
... chaining emitters can also have their methods chained: target.on('message', handlemessage) .on('data', parsedata) .on('
error', handle
error); eventtarget eventtarget is an exemplar for creating an objects that can be used to add / remove event listeners on them.
cfx - Archive of obsolete content
for example, to pass the -jsconsole argument to firefox, which will launch the javascript
error console, try the following: cfx run --binary-args -jsconsole to pass multiple arguments, or arguments containing spaces, quote them: cfx run --binary-args '-url "www.mozilla.org" -jsconsole' --extra-packages=extra_packages extra packages to include, specified as a comma-separated list of package names.
... for example, to pass the -jsconsole argument to firefox, which will launch the javascript
error console, try the following: cfx run --binary-args -jsconsole to pass multiple arguments, or arguments containing spaces, quote them: cfx run --binary-args '-url "www.mozilla.org" -jsconsole' --dependencies load and run any tests that are included with modules that your package depends on.
... --stop-on-
error stop running tests after the first failure.
JavaScript Debugger Service - Archive of obsolete content
jsd.scripthook = { onscriptcreated: function(script) { // your function here }, onscriptdestroyed: function(script) { // your function here } }; jsd.
errorhook = { on
error: function(message, filename, lineno, colno, flags, errnum, exc) { // your function here } }; // triggered when jsd.
errorhook[on
error] returns false jsd.debughook = { onexecute: function(frame, type, rv) { // your function here } }; jsd.enumeratescripts({ // the enumeratescript method will be called once for every script jsd knows about enumeratescript: function(scri...
...note that on
error is called for every exception.
... jsd.
errorhook = { on
error: function(message, filename, lineno, colno, flags, errnum, exc) { dump(message + "@" + filename + "@" + lineno + "@" + colno + "@" + errnum + "\n"); // check message type var jsdi
errorhook = components.interfaces.jsdi
errorhook; var messagetype; if (flags & jsdi
errorhook.report_
error) messagetype = "
error"; if (flags & jsdi
errorhook.report_warning) messagetype = "warning"; if (flags & jsdi
errorhook.report_exception) messagetype = "uncaught-exception"; if (flags & jsdi
errorhook.report_strict) messagetype += "-strict"; dump(messagetype + "\n"); return false; // trigger debughook // return true; if you do not wish to trigger debughook } }; // note that debughook does not _always_ trigger when jsd.
errorhook[on
error] returns ...
JavaScript Daemons Management - Archive of obsolete content
|*| http://www.gnu.org/licenses/gpl-3.0.html |*| \*/ "use strict"; /**************************** * the daemon system * ****************************/ /* the global "daemon" constructor */ function daemon (oowner, ftask, nrate, nlen, finit, fonstart) { if (!(this && this instanceof daemon)) { return; } if (arguments.length < 2) { throw new type
error("daemon - not enough arguments"); } if (oowner) { this.owner = oowner }; this.task = ftask; if (isfinite(nrate) && nrate > 0) { this.rate = math.floor(nrate); } if (nlen > 0) { this.length = math.floor(nlen); } if (fonstart) { this.onstart = fonstart; } if (finit) { this.onstop = finit; finit.call(oowner, this.index, this.length, this.backw); } } /* ...
... **/ daemon.construct = function (aargs) { var odmn = new this.blank(); this.apply(odmn, aargs); return odmn; }; daemon.buildaround = function (octx, nrate, nlen) { if (!octx.perform) { throw new type
error("you cannot create a daemon around an object devoid of a \"perform\" function"); } return new this(octx, octx.perform, nrate || null, nlen || null, octx.create || null, octx.prepare || null); }; /* warning!
...this.index : this.length - this.index) * this.rate) / (this.length * this.rate)); this.start(this.isatend() !== this.backw); } }; daemon.prototype.spread = function (ntime) { if (!isfinite(this.length)) { throw new type
error("daemon.prototype.spread - the length is not a finite number.
Enhanced Extension Installation - Archive of obsolete content
this function returns the guid, version, and type of the item, and also an
error code listing either success, or the reason for a failure, such as invalid guid, version, or incompatible item.
...the set of
error logs written is still neither perfect nor complete, but it's a very good start.
... log strings are written to the application's
error console (in anticipation of that api automatically logging to a file) and to the terminal window.
Jetpack Processes - Archive of obsolete content
special messages core:process-
error(context) when the jetpack process crashes, this message is sent to the parent.
...core:exception(
error) when an exception occurs in a jetpack script and is not caught, this message is sent to the parent.
... the
error object contains the following properties: filename, linenumber, and message.
Setting Up a Development Environment - Archive of obsolete content
there are also some configuration changes you should make in your testing profiles, so that you get detailed
error information in case something fails.
... the firefox
error console (tools >
error console) normally displays javascript
errors that occur on web pages, but with some tweaking you can get
error information from your extension.
...one of the most common
errors developers make is to register a js event listener or observer, and never removing it.
Tabbed browser - Archive of obsolete content
for example: var num = gbrowser.browsers.length; for (var i = 0; i < num; i++) { var b = gbrowser.getbrowseratindex(i); try { dump(b.currenturi.spec); // dump urls of all open tabs to console } catch(e) { components.utils.report
error(e); } } to learn what methods are available for <browser/> and <tabbrowser/> elements, use dom inspector or look in browser.xml for corresponding xbl bindings (or just look at the current reference pages on browser and tabbrowser.
... is same as browser var above //can stylize tab like atab.style.backgroundcolor = 'blue'; //can stylize the tab like atab.style.fontcolor = 'red'; var browser = atab.linkedbrowser; //this is the browser within the tab //this is what the example in the previous section gives //end getting other useful stuff } else { components.utils.report
error('exception: load context not found!!'); //this is likely no big deal as the channel proably has no associated window, ie: the channel was loading some resource.
...ttpchannel); if (goodies) { httpchannel.cancel(cr.ns_binding_aborted); goodies.contentwindow.location = self.data.url('pages/test.html'); } else { //dont do anything as there is no contentwindow associated with the httpchannel, liekly a google ad is loading or some ajax call or something, so this is not an
error } } return; } } }; services.obs.addobserver(httprequestobserver, "http-on-modify-request", false); //this function gets the contentwindow and other good stuff from loadcontext of httpchannel function loadcontextgoodies(httpchannel) { //httpchannel must be the subject of http-on-modify-request qi'ed to nsihttpchannel as is done on line ...
generateCRMFRequest() - Archive of obsolete content
the string found by accessing crmfobject.request is the base-64 encoded crmf message to be sent to the ca/ra, or an
error string.
... the possible
error strings are:
error string description "
error:invalidparameter:xxx" the parameter xxx was an invalid value.
... "
error:usercancel" the user has canceled the key generation operation "
error:internal
error" the software encountered some internal
error, such as out of memory ...
jspage - Archive of obsolete content
[c])){case"object":var d=function(){};d.prototype=a[c];var b=new d;a[c]=object.reset(b);break;case"array":a[c]=$unlink(a[c]); break;}return a;};new native({name:"class",initialize:class}).extend({instantiate:function(b){b._prototyping=true;var a=new b;delete b._prototyping;return a; },wrap:function(a,b,c){if(c._origin){c=c._origin;}return function(){if(c._protected&&this._current==null){throw new
error('the method "'+b+'" cannot be called.'); }var e=this.caller,f=this._current;this.caller=f;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=f;this.caller=e;return d;}.extend({_owner:a,_origin:c,_name:b}); }});class.implement({implement:function(a,d){if($type(a)=="object"){for(var e in a){this.implement(e,a[e]);}return this;}var f=class.mutators[a];if(f){d=f.call(this,d); ...
...rn this;}c[a]=class.wrap(this,a,d);break;case"object":var b=c[a]; if($type(b)=="object"){$mixin(b,d);}else{c[a]=$unlink(d);}break;case"array":c[a]=$unlink(d);break;default:c[a]=d;}return this;}});class.mutators={extends:function(a){this.parent=a; this.prototype=class.instantiate(a);this.implement("parent",function(){var b=this.caller._name,c=this.caller._owner.parent.prototype[b];if(!c){throw new
error('the method "'+b+'" has no parent.'); }return c.apply(this,arguments);}.protect());},implements:function(a){$splat(a).each(function(b){if(b instanceof function){b=class.instantiate(b);}this.implement(b); },this);}};var chain=new class({$chain:[],chain:function(){this.$chain.extend(array.flatten(arguments));return this;},callchain:function(){return(this.$chain.length)?this.$chain.shift().apply(thi...
....keys.each(function(e){this.addevent(a,e);},this);}}return this;}});element.nativeevents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,dommousescroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,domcontentloaded:1,readystatechange:1,
error:1,abort:1,scroll:1}; (function(){var a=function(b){var c=b.relatedtarget;if(c==undefined){return true;}if(c===false){return false;}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.haschild(c)); };element.events=new hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(browser.engine.gecko)?"dommousescroll":"mousewheel"}}); })();e...
Standalone XPCOM - Archive of obsolete content
here are some
error messsages and possible ways of fixing them.
... ./nstestsample:
error in loading shared libraries: libxpcom.so: cannot open shared object file: no such file or directory ld_library_path not set.
... link
errors when building xpcom standalone this is usually due to xpcom not being built standalone.
Abc Assembler Tests - Archive of obsolete content
when run, the assembler tests include the abcasm/abs_helper.as file which defines the following functions: start(summary:string):void - start a new test section described by summary end():void - test section finished compare_stricteq(name:string, expected:*, actual:*):void - compare the results of a testcase where name is the testcase name compare_type
error(name:string, expected:*, actual:*):void - special function for comparing type
errors (runtime
errors) - will only compare the first 22 chars of expected and actual so that test can be run in release and releasedebugger configurations.
...n .function_id(runtest) getlocal0 call 0 findproperty end callpropvoid end 0 returnvoid } function runtest() { // test null <= null == true findproperty compare_stricteq pushstring "null lessequals null" // testname pushtrue // expected pushnull pushnull lessequals // actual callpropvoid compare_stricteq 3 // use .try / .catch to catch type
error // convert_o null .try { pushnull convert_o pop findproperty fail pushstring "convert_o null" pushstring "exception should have been thrown: type
error:
error #1009: cannot access a property or method of a null object reference." getlocal1 callpropvoid fail 3 jump finished_convert_o_null } .catch { ge...
...tlocal0 pushscope setlocal2 // save type
error findproperty compare_type
error pushstring "convert_o null" // test name pushstring "type
error:
error #1009" // expected getlocal2 // actual callpropvoid compare_type
error 3 } finished_convert_o_null: } ...
Actionscript Acceptance Tests - Archive of obsolete content
('est', 'edt') ('cst', 'cdt') ('mst', 'mdt') ('pst', 'pdt') testname.err this file is used when the test throws an uncatchable
error.
... the first line must contain the expected
error (without the extra debugger information).
...verify
error:
error #1021 exitcode: 1 testname.exitcode file that specifies the expected exitcode.
Venkman Introduction - Archive of obsolete content
you can also use commands available in the debug menu and from the console to stop at
errors or at exceptions.
...for these lines, the interactive session view will display an
error message explaining why the breakpoint could not be set.
...if no loaded files match the file pattern or line number, an
error message is printed to the console and the command fails.
patch - Archive of obsolete content
returns an integer
error code.
...if the existing version of the file does not match the checksum stored in the gdiff file, patch returns an
error without applying the patch.
...if the checksums do not match, the original version of the file is preserved, the patched version of the file is discarded, and an
error code is returned.
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
copy and paste the line from here, to avoid typing
errors: content,install,url,resource:/chrome/custombutton/ explanation: this line registers your custom toolbar button extension, linking it into seamonkey.
...advanced troubleshooting if you have some technical knowledge, then you can use the seamonkey's javascript console to see
error messages.
...you might have to use trial and
error to find values that work well, and you might find that not all positions are possible using this technique.
Adding Event Handlers - Archive of obsolete content
by default the javascript console only shows
errors from web content.
... to show
errors in chrome javascript, it is necessary to change the preference javascript.options.showinconsole to true.
...by setting this value to true, non-standard, poorly written, or syntax prone to cause logic
errors are logged to the javascript console.
window - Archive of obsolete content
faultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata see also: dom window object methods note the
error message "xml parsing
error: undefined entity...<window" can be caused by a missing or unreachable dtd file referenced in the xul file.
... a filename following the system keyword in a doctype declaration may silently fail to load and the only
error message will be an undefined entity
error on the next xul element.
...if it is placed between box tags, window controls are rendered fine, but still there is this
error message.
XUL Explorer - Archive of obsolete content
a xul validator and the
error console are both available to help debug problems.
... indicator in the statusbar shows
errors.
... double-click to display
error console.
2006-10-26 - Archive of obsolete content
gavin replies that "[t]he log file shows a "no space left on device"
error when trying to link the final executable." learn the traffic magic of search engine cloaking mark describes the magic of search engine cloaker.
... bug in firefox when import passwords from seamonkey a possible bug find - perhaps a version
error instead?
...
error building firefox-2.0rc3 on uclinux an
error was found about building on uclinux, user googgled the
error and suggests that the
error found in older versions.
2006-10-27 - Archive of obsolete content
gavin replies that "[t]he log file shows a "no space left on device"
error when trying to link the final executable." learn the traffic magic of search engine cloaking mark describes the magic of search engine cloaker.
... bug in firefox when import passwords from seamonkey a possible bug find - perhaps a version
error instead?
...
error building firefox-2.0rc3 on uclinux an
error was found about building on uclinux, user googgled the
error and suggests that the
error found in older versions.
2006-11-03 - Archive of obsolete content
summary: mozilla.dev.builds - october 28th to november 3rd 2006 no such file or directory (build problem on winxp) november 2nd: kenoa complained that when he is compiling using cygwin on win32 he gets the following
error no such file or directory1: /cygdrive/c/mozilla/mail/config/mozconfig client.mk:339: /cygdrive/c/mozilla/.mozconfig.mk: no such file or directory he claims that the file ".mozconfig" exists in /cygdrive/c/mozilla/mail/config/mozconfig the disable-crypto cause problem originally posted on november 2nd: gxk is building minimo using the code base from sept.
... problem compiling with vs 2003 .net phil is trying to compile firefox for the first time and is getting an
error when doing so: building deps for /cygdrive/c/mozilla/toolkit/airbag/airbag/src/common/windows/guid_string.cc make[1]: leaving directory `/cygdrive/c/mozilla/obj-i686-pc-cygwin' make: *** [build]
error 2 he also noted that he is using make 3.80-1.
...he also noted that he has had different results (
error messages when compiling) on different machines.
2006-11-17 - Archive of obsolete content
however he has been unsuccessful and gets the following
errors: checking for gtk - version >= 1.2.0...
...see the file config.log for the exact
error that occured.
...in the latter case, you may want to edit the gtk-config script: /usr/bin/gtk-config configure:
error: test for gtk failed bryan is asking for help as he is confused and has no idea what is causing the build process to fail.
NPP_NewStream - Archive of obsolete content
syntax #include <npapi.h> np
error npp_newstream(npp instance, npmimetype type, npstream* stream, npbool seekable, uint16* stype); parameters the function has the following parameters: instance pointer to current plug-in instance.
... returns if successful, the function should return nperr_no_
error.
... if unsuccessful, the function should return one of the np
error error codes.
NP_Initialize - Archive of obsolete content
syntax windows #include <npapi.h> np
error winapi np_initialize(npnetscapefuncs *anpnfuncs) unix #include <npapi.h> np
error np_initialize(npnetscapefuncs *anpnfuncs, nppluginfuncs *anppfuncs) returns if successful, the function returns nperr_no_
error.
... if unsuccessful, the plug-in is not loaded and the function returns an
error code.
... for possible values, see
error codes.
Vulnerabilities - Archive of obsolete content
vulnerability categories a software flaw vulnerability is caused by an unintended
error in the design or coding of software.
... an example is an input validation
error, such as user-provided input not being properly evaluated for malicious character strings and overly long values associated with known attacks.
... another example is a race condition
error that allows the attacker to perform a specific action with elevated privileges.
Object.prototype.__noSuchMethod__ - Archive of obsolete content
} id the name of the non-existent method that was called args an array of the arguments passed to the method description by default, an attempt to call a method that doesn't exist on an object results in a type
error being thrown.
... if this method cannot be called, either as if undefined by default, if deleted, or if manually set to a non-function, the javascript engine will revert to throwing type
errors.
...inheritance objects as parents function nomethod(name, args) { var parents = this.__parents_; // go through all parents for (var i = 0; i < parents.length; i++) { // if we find a function on the parent, we call it if (typeof parents[i][name] == 'function') { return parents[i][name].apply(this, args); } } // if we get here, the method hasn't been found throw new type
error; } // used to add a parent for multiple inheritance function addparent(obj, parent) { // if the object isn't initialized, initialize it if (!obj.__parents_) { obj.__parents_ = []; obj.__nosuchmethod__ = nomethod; } // add the parent obj.__parents_.push(parent); } an example of using this idea is shown below.
JSException - Archive of obsolete content
extends runtimeexception java.lang.object | +----java.lang.throwable | +----java.lang.exception | +----java.lang.runtimeexception | +----netscape.javascript.jsexception description jsexception is an exception which is thrown when javascript code returns an
error.
... filename the url of the file where the
error occurred, if possible.
... tokenindex the index into the source string where the
error occurred.
Common causes of memory leaks in extensions - Extensions
while bug 695480 should prevent most of these compartment leaks, add-ons still need to be aware of the practices that caused these leaks, as the fix causes many add-ons which would have otherwise caused a leak to instead throw
errors when attempting to access nodes from documents which no longer exist.
... strict mode also excludes several other
error-prone code patterns.
... components.utils.unload("chrome://myaddon/content/mymodule.jsm"); } note: modules not belonging to your add-on — such as services.jsm — should not be unloaded by your add-on, as this might cause
errors and/or performance regressions and will actually increase the memory usage.
Debugging CSS - Learn web development
take a step back from the problem any coding problem can be frustrating, especially css problems because you often don't get an
error message to search for online to help with finding a solution.
... browsers expect your css and html to be correctly written, however browsers are also very forgiving and will try their best to display your webpages even if you have
errors in the markup or stylesheet.
...a good first step therefore is to run your html and css through a validator, to pick up and fix any
errors.
What are browser developer tools? - Learn web development
it allows you to run lines of javascript against the page currently loaded in the browser, and reports the
errors encountered as the browser tries to execute your code.
... alert('hello!); document.cheeseselector('html').style.backgroundcolor = 'purple'; const mywordmark = document.createelement('img'); mybanana.setattribute('src','https://blog.mozilla.org/press/wp-content/themes/onemozilla/img/mozilla-wordmark.png'); document.queryselector('h1').appendchild(mywordmark); you'll start to see the kind of
errors that the browser returns.
... often these
errors are fairly cryptic, but it should be pretty simple to figure these problems out!
What is a web server? - Learn web development
the web server must answer every http request, at least with an
error message.
... if neither process is possible, the web server returns an
error message to the browser, most commonly 404 not found.
... (the 404
error is so common that some web designers devote considerable time and effort to designing 404
error pages.) static vs.
Test your skills: Form validation - Learn web development
try submitting your form — it should refuse to submit until the above constaints are followed, and give suitable
error messages.
...we would like you to use the constraint validation api, plus some form validation attributes, to program some custom
error messages.
...if it doesn't look like an email address or is too short, provide the user with appropriate custom
error messages.
Index - Learn web development
troubleshooting javascript article, beginner, codingscripting, debugging, developer tools,
error, javascript, learn, tutorial, console.log, l10n:priority so there we have it, the basics of figuring out
errors in simple javascript programs.
... 233 debugging html beginner, codingscripting, debugging,
error, guide, html, validation, validator so there we have it, an introduction to debugging html, which should give you some useful skills to count on when you start to debug css, javascript, and other types of code later on in your career.
... 312 client-side form validation beginner, example, forms, guide, html, javascript, learn, web, regex client-side form validation sometimes requires javascript if you want to customize styling and
error messages, but it always requires you to think carefully about the user.
Function return values - Learn web development
if the entered value is not a number, an
error message is printed to the paragraph.
... some extra function related tips: look at another example of writing
error handling into functions.
...this way, your program will be less likely to throw
errors.
Client-side storage - Learn web development
now add the following event handlers just below your previous addition — again inside the window.onload handler: // on
error handler signifies that the database didn't open successfully request.on
error = function() { console.log('database failed to open'); }; // onsuccess handler signifies that the database opened successfully request.onsuccess = function() { console.log('database opened successfully'); // store the opened database object in the db variable.
... this is used a lot below db = request.result; // run the displaydata() function to display the notes already in the idb displaydata(); }; the request.on
error handler will run if the system comes back saying that the request failed.
... displaydata(); }; transaction.on
error = function() { console.log('transaction not opened due to
error'); }; } this is quite complex; breaking it down, we: run event.preventdefault() on the event object to stop the form actually submitting in the conventional manner (this would cause a page refresh and spoil the experience).
Ember resources and troubleshooting - Learn web development
handle loading and
error states from the minimally required data.
...
error — what to do when an
error is thrown from model.
... both loading and
error can render default templates as well as customized templates defined elsewhere in the application, unifying loading/
error states.
Getting started with React - Learn web development
if you skip this step, your application will produce an
error.
...if you were to rename the app function to app, your browser would show you an
error.
...writing just <app> or just <img> will cause an
error.
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
// reference to the name input dom node if (autofocus) nameel.focus() now go back to the todos component, and pass the autofocus prop into the <newtodo> component call, like so: <!-- newtodo --> <newtodo autofocus on:addtodo={e => addtodo(e.detail)} /> if you try your app out now, you'll see that the page is now blank, and in your devtools web console you'll see an
error along the lines of: type
error: nameel is undefined.
... to start with, add the following line at the beginning of the newtodo.svelte <script> section: import { onmount } from 'svelte' and these lines at the end of it: console.log('initializing:', nameel) onmount( () => { console.log('mounted:', nameel) }) now remove the if (autofocus) nameel.focus() line to avoid throwing the
error we were seeing before.
...ion onedit() { editing = true // enter editing mode nameel.focus() // set focus to name input } and finally, bind nameel to the <input> field, by updating it like so: <input bind:value={name} bind:this={nameel} type="text" id="todo-{todo.id}" autocomplete="off" class="todo-text" /> however, when you try the updated app you'll get an
error along the lines of "type
error: nameel is undefined" in the console when you press a todo's edit button.
Handling common accessibility problems - Learn web development
don't use <div> elements with javascript code to fake functionality if at all possible — it is
error prone, and more work than using the free functionality html gives you.
... tenon: another nice online tool that goes through the code at a provided url and returns results on accessibility
errors including metrics, specific
errors along with the wcag criteria they affect, and suggested fixes.
...like the others, it checks pages and returns accessibility
errors.
Package management basics - Learn web development
open it up and it should look something like this: { "name": "parcel-experiment", "version": "1.0.0", "description": "a simple npm package to learn about using npm", "main": "index.js", "scripts": { "test": "echo \"
error: no test specified\" && exit 1" }, "author": "chris mills", "license": "isc" } so this is the config file that defines your package.
... note: if you have trouble with the terminal returning a "command not found" type
error, try running the above command with the npx utility, i.e.
...open it up, and its scripts member should look like this: "scripts": { "test": "echo \"
error: no test specified\" && exit 1", }, update it so that it looks like this, and save the file: "scripts": { "test": "echo \"
error: no test specified\" && exit 1", "dev": "parcel serve index.html" }, we’ve added a custom dev command as an npm script.
Debugging Frame Reflow
other reflow debug options gecko_display_reflow_flag_pixel_
errors setting this option via set gecko_display_reflow_flag_pixel_
errors = 1 enables a verification for each coordinate value that the coordinates are aligned at pixel boundaries.
... block 0268a764 r=0 a=uc,uc c=uc,uc cnt=872 block 0268a764 d=0,0 me=0 cell 0268a6c0 d=0,0 me=0 row 0268a594 d=uc,20 value 20 is not a whole pixel rowg 0268a02c d=uc,695 value 695 is not a whole pixel while unaligned values at the entrance of a frame reflow can be ignored, when they appear at the exit of a routine this can cause display
errors like stray lines.
... os2 is very vulnerable to pixel alignment
errors as text is drawn on pixel boundaries.
Old Thunderbird build
on linux, this can manifest as problems setting up the virtualenv for running tests (failure to install pip or virtualenv because of os access denied
errors, where access is denied not because of permission problems, but because the paths being accessed have been truncated, and so do not exist).
... try asking in mozilla.dev.builds - include details of what is in your mozconfig, and what the actual
error is.
... if on windows you get link
errors like "lnk1102: out of memory" or "lnk1318: unexpected pdb
error; ok (0)", try deleting the largest .pdb files before rushing out the door to buy more ram.
Simple Thunderbird build
on linux, this can manifest as problems setting up the virtualenv for running tests (failure to install pip or virtualenv because of os access denied
errors, where access is denied not because of permission problems, but because the paths being accessed have been truncated, and so do not exist).
... try asking in mozilla.dev.builds - include details of what is in your mozconfig, and what the actual
error is.
... if on windows you get link
errors like "lnk1102: out of memory" or "lnk1318: unexpected pdb
error; ok (0)", try deleting the largest .pdb files before rushing out the door to buy more ram.
ESLint
this lets you see
errors in real time, and can help you fix issues before you compile or run tests, reducing the time to develop patches.
... understanding rules and
errors not all files are linted currently eslint runs on: .js .jsx .jsm .xml .html .xhtml additionally, some directories and files are ignored, see the .eslintignore file handling
errors if your code fails an eslint rule, you'll get an
error similar to this: /gecko/toolkit/mozapps/installer/js-compare-ast.js 18:39
error 'snarf' is not defined.
... for example: in windows 10, if you have installed node.js on "c:\nodejs", then the command should look like: export path=$path:/c/nodejs enabling eslint for a new directory remove the directory from .eslintignore (in the base directory of the repository) fix
errors that occur when running ./mach eslint path/to/dir, see also the no-undef rules below.
Gecko Logging
error 1 an
error occurred, generally something you would consider asserting in a debug build.
... if (moz_log_test(slogger, loglevel::warning)) { int elapsed = time::nowms() - start; if (elapsed > 1000) { moz_log(slogger, loglevel::warning, ("loop took %dms!", elapsed)); } } if (i != 10) { moz_log(slogger, loglevel::
error, ("i should be 10!")); } } enabling logging the log level for a module is controlled by setting an environment variable before launching the application.
... the log crate lists the available log levels: log level purpose rust logging levels
error designates very serious
errors.
Using the Browser API
prev.disabled = true; next.disabled = true; searchbar.value = ''; } } }); note that whenever one of the search-related methods is invoked, a mozbrowserfindchange event is fired to allow you to react to search changes in a more precise way if desired: //browser.addeventlistener('mozbrowserfindchange', function(e) { // can react to find changes if required //}) reporting
errors we've got one more piece of code to mention from our source: browser.addeventlistener('mozbrowser
error', function (e) { console.log("loading
error: " + e.detail); }); this simple listener logs an
error message to the console when an
error with the browser iframe is encountered.
... note that this doesn't include simple
errors due to incorrect urls being entered.
... see the mozbrowser
error page for more details.
mozbrowseractivitydone
if the activity has a returnvalue set to true, then the activity is consumed when postresult or post
error is invoked on the activity by the receiving app.
...postresult and post
error calls made on such an activity will be ignored and have no effect.
... examples var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowseractivitydone", function(event) { if(event.details.success) { console.log('activity completed successfully'); } else { console.log('activity not completed successfully'); } }); related events mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
Implementing Download Resuming
the server is not using http 1.1), then accessing this attribute will throw an ns_
error_not_resumable exception.
... detecting when a file changed if the file changed (that is, the entity id does not match), then necko will notify the stream listener with an ns_
error_entity_changed
error code.
...in such a case, the stream listener will get an ns_
error_not_resumable status.
Addon
reviewcount read only integer reviewurl read only string totaldownloads read only integer weeklydownloads read only integer dailyusers read only integer repositorystatus read only integer callbacks datadirectorycallback() a callback which is passed a directory path, and, when an
error has occured, an
error object.
... void datadirectorycallback( in string path, in
error error ) parameters path a string representation of the addon's data directory.
...
error if an
error has occured, an
error object relevant to the
error, othereise null.
UpdateCheckListener
method overview void onupdatecheckcomplete(in updateinfo results[]) void onupdatecheck
error(in integer status) methods onupdatecheckcomplete() called when the update check completed successfully.
... void onupdatecheckcomplete( in updateinfo results[] ) parameters results an array of updateinfo objects representing the available add-on versions onupdatecheck
error() called when the update check fails.
... void onupdatecheck
error( in integer status ) parameters status a value representing the type of failure; see the range of possible values.
FxAccountsProfileClient.jsm
rejects: fxaccountsprofileclient
error - profile client
error.
... examples using the fxaccountsprofileclient chrome code let client = new fxaccountsprofileclient({ serverurl: "https://profile.accounts.firefox.com/v1", token: "fxa_oauth_bearer_token", }); client.fetchprofile().then(profile => console.log(profile));
error handling the fxaccountsprofileclient.jsm normalizes request and client
errors into fxaccountsprofileclient
error object.
... fxaccountsprofileclient
error attributes name string name of the
error fxaccountsprofileclient
error code number status code of the request errno number
error number
error string
error description message string
error message ...
Promise.jsm
rejected, if an
error prevented the final value from being determined.
...this may be any value, including undefined, though it is generally an
error object, like in exception handling.
...although the reason can be undefined, it is generally an
error object, like in exception handling.
Localization content best practices
if you're reviewing a patch, check also strings for grammar
errors, capitalization or inconsistencies.
... test localizability as a developer, you should always test your patches not just for code
errors, but also for localizability issues in case they involve string or ui changes.
...if your changes are relevant only for english — for example, to correct a typographical
error or to make letter case consistent — then there is generally no need to update the entity name.
Localization formats
diffs .lang files will be cached which will reduce any slowness effect disadvantage to .lang no plural forms no context for localizers unless you provide good comments no styling by localizers if it is needed may be slower because file is not compiled into binaries not used as a standard by any other localization project no tools to validate syntax, so a localizer may cause accidental
errors that can cause breakage (level of breakage depends on level of
error) cannot use po editor, which most localizers know and love gettext (.po) gettext is a widely-used localization format that uses .po files.
... without having the exact content as the msgid, this process may cause several
errors since the localizers cannot has to continually switch back-and-forth.
... in this case, the choice to use customized values for msgid was
error-prone, onerous, and unfamiliar to localizers who are used to more customary gettext operations.
A brief guide to Mozilla preferences
if the application encounters any
error during loading of a default pref file, the application will issue a warning that a configuration file has failed to load and then quit.
... this allows system administrators to know quickly if there is a configuration
error in the installation.
... if the application encounters an
error when loading user pref files, the application will issue a warning but will continue running.
javascript.options.showInConsole
the preference javascript.options.showinconsole controls whether
errors or warnings in chrome code are shown in the
error console.
... type:boolean default value: false (true in debug builds) exists by default: yes application support:firefox 1.0 status: active introduction:2002-02-26 bugs: bug 125181 bug 337875 values false only
errors and warnings from content code are shown.
... true (default)
errors and warnings from both chrome and content are shown in the
error console.
Nonblocking IO In NSPR
an io function on a nonblocking file descriptor either succeeds immediately or fails immediately with <tt>pr_would_block_
error</tt>.
...one can make the new socket nonblocking by using <tt>pr_setsockopt()</tt> as in the example below (
error checking is omitted for clarity): <tt>prfiledesc *sock;</tt> <tt>printn optval = 1;</tt> <tt>sock = pr_newtcpsocket();</tt> /* * make the socket nonblocking */ pr_setsockopt(sock, pr_sockopt_nonblocking, &optval, sizeof(optval)); programming constraints there are some constraints due to the use of nt asynchronous i/o in the nspr.
...i.e., <tt>pr_recv()</tt> would block (a blocking socket) or fail with <tt>pr_would_block_
error</tt> (a nonblocking socket).
PR_Accept
further information can be obtained by calling pr_get
error.
... pr_accept blocks the calling thread until either a new connection is successfully accepted or an
error occurs.
... if the timeout parameter is not pr_interval_no_timeout and no pending connection can be accepted before the time limit, pr_accept returns null with the
error code pr_io_timeout_
error.
PR_ConnectContinue
if pr_connectcontinue() returns pr_failure, call pr_get
error(): - pr_in_progress_
error: the nonblocking connect is still in progress and has not completed yet.
... - other
errors: the nonblocking connect has failed with this
error code.
...after a nonblocking connect is initiated with pr_connect() (which fails with pr_in_progress_
error), one should call pr_poll() on the socket, with the in_flags pr_poll_write | pr_poll_except.
PR_GetConnectStatus
the reason for the failure can be retrieved via pr_get
error.
... if pr_get
error returns pr_in_progress_
error, the nonblocking connection is still in progress and has not completed yet.other
errors indicate that the connection has failed.
... description after pr_connect on a nonblocking socket fails with pr_in_progress_
error, you may wait for the connection to complete by calling pr_poll on the socket with the in_flags pr_poll_write | pr_poll_except.
PR_Interrupt
the interrupted thread returns pr_failure (-1) with an
error code (see pr_get
error) for blocking operations that return a prstatus (such as i/o operations, monitor waits, or waiting on a condition).
... to check whether the thread was interrupted, compare the result of pr_get
error with pr_pending_interrupt_
error.
...unfortunately the standard input, output, and
error streams are treated as files by nspr, so a pr_read call on pr_stdin cannot be interrupted even though it may block indefinitely.
PR_ReadDir
if the end of the directory is reached or an
error occurs, null.
... the reason can be retrieved via pr_get
error.
... if the end of the directory is reached, pr_readdir returns null, and pr_get
error returns pr_no_more_files_
error.
PR_STATIC_ASSERT
an expression which cannot be evaluated at compile time will cause a compiler
error; see pr_assert for a runtime alternative.
...when the result is zero (false) program compilation will fail with a compiler
error; otherwise compilation completes successfully.
... the compiler
error will include the number of the line for which the compile-time assertion failed.
NSS 3.21 release notes
ckm_tls_mac - computes tls finished mac in secoidt.h nss_use_alg_in_ssl_kx - policy flag indicating that keys are used in tls key exchange in sslerr.h ssl_
error_rx_short_dtls_read -
error code for failure to include a complete dtls record in a udp packet ssl_
error_no_supported_signature_algorithm -
error code for when no valid signature and hash algorithm is available ssl_
error_unsupported_signature_algorithm -
error code for when an unsupported signature and hash algorithm is configured ssl_
error_missing_extended_master_secret -
error code for ...
...when the extended master secret is missing after having been negotiated ssl_
error_unexpected_extended_master_secret -
error code for receiving an extended master secret when previously not negotiated in sslt.h ssl_enable_extended_master_secret - configuration to enable the tls extended master secret extension (rfc 7627) ssl_preinfo_version - used with sslpreliminarychannelinfo to indicate that a tls version has been selected ssl_preinfo_cipher_suite - used with sslpreliminarychannelinfo to indicate that a tls cipher suite has been selected ssl_preinfo_all - used with sslpreliminarychannelinfo to indicate that all preliminary information has been set notable changes in nss 3.21 nss now builds with elliptic curve ciphers enabled by default (bug 1205688) nss now ...
...builds with warnings as
errors (bug 1182667) the following ca certificates were removed cn = verisign class 4 public primary certification authority - g3 sha1 fingerprint: c8:ec:8c:87:92:69:cb:4b:ab:39:e9:8d:7e:57:67:f3:14:95:73:9d cn = utn-userfirst-network applications sha1 fingerprint: 5d:98:9c:db:15:96:11:36:51:65:64:1b:56:0f:db:ea:2a:c2:3e:f1 cn = tc trustcenter universal ca iii sha1 fingerprint: 96:56:cd:7b:57:96:98:95:d0:e1:41:46:68:06:fb:b8:c6:11:06:87 cn = a-trust-nqual-03 sha-1 fingerprint: d3:c0:63:f2:19:ed:07:3e:34:ad:5d:75:0b:32:76:29:ff:d5:9a:f2 cn = usertrust legacy secure server ca sha-1 fingerprint: 7c:2f:91:e2:bb:96:68:a9:c6:f6:bd:10:19:2c:6b:52:5a:1b:ba:48 frie...
NSS Sample Code sample4
tcertificate *cert = null; seckeypublickey *pubkey = null; seckeyprivatekey *pvtkey = null; int modulus_len, i, outlen; char *buf1 = null; char *buf2 = null; /* initialize nss */ pk11_setpasswordfunc(passwdcb); rv = nss_init("."); if (rv != secsuccess) { fprintf(stderr, "nss initialization failed (err %d)\n", pr_get
error()); goto cleanup; } cert = pk11_findcertfromnickname("testca", null); if (cert == null) { fprintf(stderr, "couldn't find cert testca in nss db (err %d)\n", pr_get
error()); goto cleanup; } pubkey = cert_extractpublickey(cert); if (pubkey == null) { fprintf(stderr, "couldn't extract public key from cert testca (err %d)\n", pr_get
error()); ...
...* initialize buf1 */ for (i=0;i<modulus_len;i++) { buf1[i]= (i %26) + 'a'; } buf1[modulus_len-1] = '\0'; fprintf(stderr, "buffer being encrypted = \n%s\n", buf1); /* encrypt buf1, result will be in buf2 */ rv = pk11_pubencryptraw(pubkey, buf2, buf1, modulus_len, null); if (rv != secsuccess) { fprintf(stderr, "encrypt with public key failed (err %d)\n", pr_get
error()); goto cleanup; } pvtkey = pk11_findkeybyanycert(cert, null); if (pvtkey == null) { fprintf(stderr, "couldn't find private key for cert testca (err %d)\n", pr_get
error()); goto cleanup; } /* clear buf1 */ for (i=0;i<modulus_len;i++) { buf1[i]= '\0'; } /* decrypt buf2, result will be in buf1 */ rv = pk11_pubdecryptraw(pvtkey, buf1, &outlen, mo...
...dulus_len, buf2, modulus_len); if (rv != secsuccess) { fprintf(stderr, "decrypt with private key failed (err %d)\n", pr_get
error()); goto cleanup; } fprintf(stderr, "result of decryption, outlen = %d\n", outlen); fprintf(stderr, "result of decryption, buf = \n%s\n", buf1); exit(0); cleanup: if (cert) cert_destroycertificate(cert); if (pubkey) seckey_destroypublickey(pubkey); if (pvtkey) seckey_destroyprivatekey(pvtkey); if (buf1) free(buf1); if (buf2) free(buf2); exit(1); } char *passwdcb(pk11slotinfo *info, prbool retry, void *arg) { if (!retry) return pl_strdup("test"); else return null; } ...
Utilities for nss samples
*/ #ifndef _util_h #define _util_h #include <prlog.h> #include <termios.h> #include <base64.h> #include <unistd.h> #include <sys/stat.h> #include "util.h" #include <prprf.h> #include <pr
error.h> #include <nss.h> #include <pk11func.h> /* * these utility functions are adapted from those found in * the sectool library used by the nss security tools and * other nss test applications.
...lename, &stbuf); return stbuf.st_size; } /* * readderfromfile */ secstatus readderfromfile(secitem *der, const char *infilename, prbool ascii) { secstatus rv = secsuccess; prfiledesc *infile = null; infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "failed to open file \"%s\" (%ld, %ld).\n", infilename, pr_get
error(), pr_getos
error()); rv = secfailure; goto cleanup; } if (ascii) { /* first convert ascii to binary */ secitem filedata; char *asc, *body; /* read in ascii data */ rv = filetoitem(&filedata, infile); asc = (char *)filedata.data; if (!asc) { pr_fprintf(pr_stderr, "unable to read data from input file\n"); ...
... } else { pr_fprintf(pr_stderr, "input has header but no trailer\n"); port_free(filedata.data); rv = secfailure; goto cleanup; } } else { body = asc; } /* convert to binary */ rv = atob_convertasciitoitem(der, body); if (rv) { pr_fprintf(pr_stderr, "
error converting ascii to binary %s\n", port_get
error()); port_free(filedata.data); rv = secfailure; goto cleanup; } port_free(filedata.data); } else { /* read in binary der */ rv = filetoitem(der, infile); if (rv) { pr_fprintf(pr_stderr, "
error converting der \n"); rv = secfa...
NSS tools : pk12util
return codes o 0 - no
error o 1 - user cancelled o 2 - usage
error o 6 - nls init
error o 8 - certificate db open
error o 9 - key db open
error o 10 - file initialization
error o 11 - unicode conversion
error o 12 - temporary file creation
error o 13 - pkcs11 get slot
error o 14 - pkcs12 decoder start
error o 15 -
error read from import file o 16 - pkcs12 decode
error o 17 - pkcs12 decoder verify
error o 18 - ...
...pkcs12 decoder validate bags
error o 19 - pkcs12 decoder import bags
error o 20 - key db conversion version 3 to version 2
error o 21 - cert db conversion version 7 to version 5
error o 22 - cert and key dbs patch
error o 23 - get default cert db
error o 24 - find cert by nickname
error o 25 - create export context
error o 26 - pkcs12 add password itegrity
error o 27 - cert and key safes creation
error o 28 - pkcs12 add cert and key
error o 29 - pkcs12 encode
error examples importing keys and certificates the most basic usage of pk12util for importing a certificate or key is the pkcs#12 input file (-i) and some way to specify the security database being accessed (either -d for a directory or -h for a token).
...if no suitable replacement for the desired algorithm can be found, the tool returns the
error no security module can perform the requested operation.
OLD SSL Reference
pk11_findcertfromnickname pk11_findkeybyanycert pk11_getslotname pk11_gettokenname pk11_ishw pk11_ispresent pk11_isreadonly pk11_setpasswordfunc chapter 8 nss and ssl
error codes nss
error codes are retrieved using the nspr function pr_get
error.
... in addition to the
error codes defined by nspr, pr_get
error retrieves the
error codes described in this chapter.
... ssl
error codes sec
error codes ...
sslcrt.html
use pr_get
error to obtain the
error code.
...use pr_get
error to obtain the
error code.
...use pr_get
error to obtain the
error code.
NSS Tools pk12util
if no suitable replacement for the desired algorithm can be found a "no security module can perform the requested operation" will appear on the
error message.
...
error codes pk12util can return the following values: 0 - no
error 1 - user cancelled 2 - usage
error 6 - nls init
error 8 - certificate db open
error 9 - key db open
error 10 - file initialization
error 11 - unicode conversion
error 12 - temporary file creation
error 13 - pkcs11 get slot
error 14 - pkcs12 decoder start
error 15 -
error read from import file 16 - pkcs12 decode
error 17 - pkcs12 decoder verify
error 18 - pkcs12 decoder validate bags
error 19 - pkcs12 decoder import bags
error 20 - key db conversion version 3 to version 2
error 21 - cert db conversion version 7 to version 5
error 22 - cert and key dbs patch
error 23 - get default cert db
error 24 - find cert by nickname
error 25 - create export context
error 26 - pkcs12 add password itegrity
error 27 - cert and key safes c...
...reation
error 28 - pkcs12 add cert and key
error 29 - pkcs12 encode
error ...
NSS tools : pk12util
return codes o 0 - no
error o 1 - user cancelled o 2 - usage
error o 6 - nls init
error o 8 - certificate db open
error o 9 - key db open
error o 10 - file initialization
error o 11 - unicode conversion
error o 12 - temporary file creation
error o 13 - pkcs11 get slot
error o 14 - pkcs12 decoder start
error o 15 -
error read from import file o 16 - pkcs...
...12 decode
error o 17 - pkcs12 decoder verify
error o 18 - pkcs12 decoder validate bags
error o 19 - pkcs12 decoder import bags
error o 20 - key db conversion version 3 to version 2
error o 21 - cert db conversion version 7 to version 5
error o 22 - cert and key dbs patch
error o 23 - get default cert db
error o 24 - find cert by nickname
error o 25 - create export context
error o 26 - pkcs12 add password itegrity
error o 27 - cert and key safes creation
error o 28 - pkcs12 add cert and key
error o 29 - pkcs12 encode
error examples importing keys and certificates the most basic usage of pk12util for importing a certificate or key is the pkcs#12 input file (-i) and some way to specify the security database ...
...if no suitable replacement for the desired algorithm can be found, the tool returns the
error no security module can perform the requested operation.
NSS tools : signtool
note that versions 1.1 and later of netscape signing tool correctly recognizes the codebase attribute, allows paths to be expressed for the class and src attributes instead of filenames only, processes link tags and parses html correctly, and offers clearer
error messages.
...a value of -1 suppresses most messages, but not
error messages.
... outfile name of a file to which output and
error messages will be redirected.
Pork Tools
if (!*aresult) return ns_
error_failure; return ns_ok; } nsifoo* getter() { nsifoo *result = null; // aresult below is kept for complicated cases // typically it wont be needed and can be removed nsifoo **aresult = &result; // *aresult patterns are replaced with result result = ...
... if (result) return nsnull; //
error returns are changed to nsnull //instead ns_ok, actual result is returned return result; } caller1 { //case 1 nsresult rv; rv = getter(&var); ns_ensure_success(rv,rv); //case 2: naked call getter(&var); //case 3: nsresult decl nsresult rv2 = getter(&var); ns_ensure_success(rv2,rv2); } caller1 { // case 1 // figure out that rv was only used for the rewritten // outparam call + ns_ensure_success.
... then nuke the declaration // nsresult rv; // move outparam to lhs var = getter(); // detect ns_ensure_success immediately following // and change it to an equivalent ns_ensure_true ns_ensure_true(var, ns_
error_failure); // case 2 var = getter(); // case 3, eliminate rv2 decl given that it's not used elsewhere var = getter(); ns_ensure_true(var, ns_
error_failure) } outparamdel also support rewriting getters such that they return already_addrefed<nsifoo>.
SpiderMonkey Build Documentation
note: if you are on mac and getting an
error similar to "checking whether the c compiler (gcc-4.2 ) works...
... no configure:
error: installation or configuration problem: c compiler cannot create executables." you can try configuring like so: cc=clang cxx=clang++ ../configure it is also possible that baldrdash may fail to compile with /usr/local/cellar/llvm/7.0.1/lib/clang/7.0.1/include/inttypes.h:30:15: fatal
error: 'inttypes.h' file not found /usr/local/cellar/llvm/7.0.1/lib/clang/7.0.1/include/inttypes.h:30:15: fatal
error: 'inttypes.h' file not found, err: true this is because, starting from mohave, headers are no longer installed in /usr/include.
...n installed to c:/mozilla-build/msys/local: /bin/sh ../configure.in --with-nspr-cflags="-ic:/mozilla-build/msys/local/include" \ --with-nspr-libs="c:/mozilla-build/msys/local/lib/libnspr4.a \ c:/mozilla-build/msys/local/lib/libplds4.a \ c:/mozilla-build/msys/local/lib/libplc4.a" if you get symbol loading or dynamic library
errors, you can force the correct nspr to load with: path="$path;c:/mozilla-build/msys/local/lib/" ./js specifying installation directories make install puts files in the following directories by default.
Creating JavaScript jstest reftests
in the javascript shell, an uncaught exception or out of memory
error will terminate the shell with an exit code of 3.
... however, an uncaught
error or exception will not cause the browser to terminate with a non-zero exit code.
... to make the situation even more complex, newer c++ compilers will abort the browser with a typical exit code of 5 by throwing a c++ exception when an out of memory
error occurs.
GC Rooting Guide
if (!was
error) *valueout = resultvalue; return was
error; } void otherfunction(jscontext *cx) { js::value value; bool success = maybegetvalue(cx, &value); // ...
... if (!was
error) valueout.set(resultvalue); return was
error; } void otherfunction(jscontext *cx) { js::rootedvalue value(cx); bool success = maybegetvalue(cx, &value); // ...
... obj.set(foo()); } (note that the above should probably check the return value and propagate an
error on null), or: jsobject* somefunction(jscontext* cx) { js::rooted<jsobject*> obj(cx, foo()); { // make a scope to force the destructor to run before obj is unwrapped.
Exact Stack Rooting
when passed to an out-param, &handle would convert correctly to js::handlet*, but &local is a compile
error.
... rootedobject obj(cx, js_newobject(cx, clasp, nullptr(), nullptr()); common pitfalls the c++ type system allows us to eliminate the possibility of most common
errors; however, there are still a few things that you can get wrong that the compiler cannot help you with.
...note: spidermonkey can gc because of any
error, gc because of timers, gc because we are low on memory, gc because of environment variables, gc because of cosmic rays, etc.
JSFastNative
(the return value and the callee are stored in the same stack slot.) js_this(cx, vp) returns the this argument as a jsval, or jsval_null on
error.
...(js_this may call js_callee.) js_this_object(cx, vp) returns the this argument as a jsobject *, or null on
error.
...on
error or exception, it must return js_false.
JS_AlreadyHasOwnProperty
if an
error occurs, the value left in *foundp is undefined.
...if the property is not found on obj, this sets *foundp to false and returns true (to indicate that no
error occurred).
... if the search fails with an
error or exception, this returns false.
JS_ConvertArguments
in certain
error cases, js_convertarguments calls js_argv_callee(argv), which accesses memory outside the range [argv ..
...if an optional argument is missing from argv, js_convertarguments neither assigns anything to any variable nor reports an
error.
... if argc is less than the number of arguments required by format, js_convertargument reports an
error and returns false.
JS_InstanceOf
if non-null, report an
error if obj is not of type clasp.
...if non-null, report an
error if obj is not of type clasp.
...otherwise, it returns false; it also reports a type
error containing the function's name.
JS_LookupProperty
if neither obj nor any of its prototypes have such a property, *vp receives undefined and the return value is true (to indicate no
error occurred).
... on
error or exception (such as running out of memory during the search), the return value is false, and the value left in *vp is undefined.
... jsresolve_classname search for the initial value of a standard class such as object, array, or
error.
JS_SetOptions
mxr id search for jsoption_extra_warnings jsoption_w
error convert warnings to
errors.
... mxr id search for jsoption_w
error jsoption_varobjfix make js_evaluatescript() use the last object on its obj param's scope chain (that is, the global object) as the ecma "variables object".
... mxr id search for jsoption_native_branch_callback jsoption_dont_report_uncaught when returning from the outermost api call, prevent uncaught exceptions from being converted to
error reports.
JS_SetProperty
otherwise, if the lookup found a read-only property or obj non-extensible, nothing happens, but this is not an
error.
...if the property has a javascript setter, it is called; otherwise, if it has a javascript getter, then an
error is reported; otherwise the property's setter is called, passing the arguments (cx, obj, id, &v).
...on
error or exception, it returns false, and the value left in v is unspecified.
JS_ValueToInt32
if the result is nan, an infinity, or a number outside the 32-bit range, js_valuetoint32 reports an
error and conversion fails.
...on
error or exception, it returns js_false, and the value left in *ip is undefined.
...js::toint32 will also convert nan (and anything that converts to nan, such as an array of strings) to 0, whereas this routine would report an
error.
JS_ValueToNumber
if at any step an
error or exception occurs, or conversion succeeds, the rest of the steps are skipped.
... otherwise conversion fails with a type
error.
...on
error or exception, it returns js_false, and the value left in *dp is undefined.
JS_ValueToString
if at any point an
error or exception occurs, or conversion succeeds, the rest of the steps are skipped.
... otherwise conversion fails with a type
error.
...on
error or exception, it returns null.
Parser API
if parsing fails due to a syntax
error, an instance of syntax
error is thrown.
... the syntax
error object thrown by reflect.parse() has the same message property as the syntax
error that would be thrown by eval(src).
... the linenumber and filename properties of the syntax
error object indicate the source location of the syntax
error.
SpiderMonkey 1.8.5
applications must use js_getstringcharsandlength or js_encodestring/js_free and check for
errors.
... if you are running valgrind on your embedding, be sure to build spidermonkey with the --enable-valgrind option to suppress superflous
error messages triggered by the garbage collector.
...typed rooting api the rooting api has been changed from an
error-prone void ** interface to an interface which accepts pointers to specific types.
TPS Tests
troubleshooting and debugging tips for writing and running tps tests tps evaluates the whole file in every phase, so any syntax
error(s) in the file will get reported in phase 1, even though the
error may not be in phase 1 itself.
...for example, most
errors involving bookmarks look like "places item not found in expected index", which could mean a number of issues.
... it's common for the phase after the problem to be the one reporting
errors (e.g.
Web Replay
seek to console messages
errors and logged messages in the console developer tool can be clicked on to cause the tab to seek to the point in the recording where the
error was generated or the message was logged.
... console
error/messages are marked on the timeline and can be clicked to seek to that point.
... the data stream should have enough
error checking in place that we can immediately detect if the replay has gone out of sync with the recording.
How to build an XPCOM component in JavaScript
for code outside the tree note: on windows if you download the gecko sdk without the whole build tree, you will be missing some required dlls for xpidl.exe and it will run with no
errors but not do anything.
...the class constructor, and you removed the "[components.interfaces.nsihelloworld]" argument for the call to xpcomutils.generateqi() in queryinterface, then you can access your component like this: try { var mycomponent = components.classes['@dietrich.ganx4.com/helloworld;1'] .getservice().wrappedjsobject; alert(mycomponent.hello()); } catch (an
error) { dump("
error: " + an
error); } for more information about wrappedjsobject, see here.
... using xpcom instantiation try { var mycomponent = components.classes['@dietrich.ganx4.com/helloworld;1'] .createinstance(components.interfaces.nsihelloworld); alert(mycomponent.hello()); } catch (an
error) { dump("
error: " + an
error); } other resources rm lantwo mozillazine forums threads about implementing xpcom components in js with some explanations, example code, and troubleshooting tips: http://forums.mozillazine.org/viewtopic.php?t=308369 http://forums.mozillazine.org/viewtopic.php?t=367298 implementing xpcom components in javascript at kb.mozillazine.org using xpcom in javascript without leaking - a must-read.
Finishing the Component
furthermore, there is no way easy way to realize this
error at runtime.
...this can prevent many
errors like this.
... here is the complete implementation of the shouldload() method: ns_imethodimp weblock::shouldload(print32 contenttype, nsiuri *contentlocation, nsisupports *ctxt, nsidomwindow *window, prbool *_retval) { if (!contentlocation) return ns_
error_failure; nsembedcstring scheme; contentlocation->getscheme(scheme); if (strcmp("http", scheme.get()) != 0 && strcmp("https", scheme.get()) != 0 && strcmp("ftp", scheme.get()) != 0) { // this isn't a type of uri that we deal with *_retval = pr_true; return ns_ok; } nsembedcstring hosttoload; contentlocation->gethost(hosttoload); // assume failure.
Mozilla internal string guide
if one tries to call a non-const method on a const string the compiler will flag this as an
error at build time.
... ns_free(val); return ns_
error_failure; } ...
...you can just use getter_copies() to wrap a string class argument, and the class will remember to free the buffer when it goes out of scope: { nsstring val; getvalue(getter_copies(val)); // val will free itself here if (somecondition) return ns_
error_failure; ...
Components.results
components.results is a read-only object whose properties are the names listed as the first parameters of the macros in js/xpconnect/src/xpc.msg (also at table of
errors), with the value of each corresponding to that constant's value.
... if(something_unexpected_happened) throw components.results.ns_
error_unexpected; the elements of the components.results object can be enumerated using a for-in loop.
...*/ queryinterface: function(id) { if (id.equals(ci.imyinterface)) return this; throw cr.ns_
error_no_interface; } }; ...
Components.utils
if the parameter is passed, the runnable will be dispatch in the compartment of the parameter, which affects which
error reporter gets called.
... report
error() reports a javascript
error object to the
error console.
... w
error boolean warnings should be treated as
errors.
HOWTO
both success and
error callbacks, put: gscriptdone = true; if you forget some condition where your script should exit but you don't add this statement, your script will hang (busy wait).
... this is of course a massive, ugly hack prone to
error, but this is what the xpcshell test harness does.
..."component returned failure code: 0x80040111 (ns_
error_not_available) [nsixpccomponents_utils.import]" nsresult: "0x80040111 (ns_
error_not_available)" location: "js frame :: file.js :: <top_level> :: line 12" data: no] solution 1 var loader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); loader.loadsubscript("chrome://myall/content/file.jsm"); see: http://mxr.mozilla.org...
Language bindings
these exception objects may be thrown when implementing xpcom interfaces in javascript, and they can provide better diagnostics in the
error console if not caught than simply throwing an nsresult's value will.components.idcomponents.id is a constructor that creates native objects that conform to the nsijsid interface.components.interfacescomponents.interfaces is a read-only object whose properties are interfaces indexed by their names.components.interfacesbyidcomponents.interfacesbyid is a read-only array of classes indexed by iid.com...
...the scriptable methods on the nsicomponentmanager interface can be called directly on this object.components.resultscomponents.results is a read-only object whose properties are the names listed as the first parameters of the macros in js/xpconnect/src/xpc.msg (also at table of
errors), with the value of each corresponding to that constant's value.components.returncodecomponents.stackcomponents.stack is a read only property of type nsistackframe (idl definition) that represents a snapshot of the current javascript callstack.
...any expando properties are not visible, and if any native properties have been redefined, this has no effect.components.utils.makeobjectpropsnormalensures that the specified object's methods are all in the object's scope, and aren't cross-component wrappers.components.utils.report
errorcomponents.utils.report
error reports a javascript
error object to the
error console, and returns.
NS_InitXPCOM2
otherwise, it returns an
error code.
... some of the possible
errors are documented below: ns_
error_not_initialized indicates that static globals were not yet initialized, which may happen if this method is called before xpcom's static initialization code executes.
... this
error may also occur if xpcom is being initialized after ns_shutdownxpcom has been called.
NS_InitXPCOM3
otherwise, it returns an
error code.
... some of the possible
errors are documented below: ns_
error_not_initialized indicates that static globals were not yet initialized, which may happen if this method is called before xpcom's static initialization code executes.
... this
error may also occur if xpcom is being initialized after ns_shutdownxpcom has been called.
mozIVisitInfoCallback
toolkit/components/places/public/moziasynchistory.idlscriptable this interface provides callback handling functionality for moziasynchistory.updateplaces() 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) method overview void handle
error(in nsresult aresultcode, in moziplaceinfo aplaceinfo); void handleresult(in moziplaceinfo aplaceinfo); void oncomplete(in nsresult aresultcode, in moziplaceinfo aplaceinfo);obsolete since gecko 8.0 methods handle
error() called when a moziplaceinfo couldn't be processed.
... void handle
error( in nsresult aresultcode, in moziplaceinfo aplaceinfo ); parameters aresultcode nsresult indicating the reason why the change failed.
... notes this method was replaced by the separate handleresult() and handle
error() methods in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5).
nsIAsyncInputStream
venttarget aeventtarget); void closewithstatus(in nsresult astatus); constants constant value description wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default behavior, causing the oninputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some
error in the underlying stream).
...the
error code returned when an attempt is made to write to a "broken" pipe corresponds to the status code passed in when the input end of the pipe was closed, which greatly simplifies working with pipes in some cases.
... void closewithstatus( in nsresult astatus ); parameters astatus the
error that will be reported if this stream is accessed after it has been closed.
nsIAsyncOutputStream
venttarget aeventtarget); void closewithstatus(in nsresult reason); constants constant value description wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default behavior, causing the onoutputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some
error in the underlying stream).
...the
error code returned when an attempt is made to read to a "closed" pipe corresponds to the status code passed in when the output end of the pipe was closed, which greatly simplifies working with pipes in some cases.
... void closewithstatus( in nsresult reason ); parameters reason the
error that will be reported if this stream is accessed after it has been closed.
nsIBidiKeyboard
note: this throws ns_
error_not_implemented if the widget layer doesn't provide this information.
...exceptions thrown ns_
error_failure if no right-to-left keyboards are installed.
... exceptions thrown ns_
error_failure if no right-to-left keyboards are installed.
nsIContentPrefCallback2
dom/interfaces/base/nsicontentprefservice2.idlscriptable callback used by nsicontentprefservice2 methods 1.0 66 introduced gecko 20.0 inherits from: nsisupports last changed in gecko 20.0 (firefox 20.0 / thunderbird 20.0 / seamonkey 2.17) method overview void handlecompletion(in unsigned short reason); void handle
error(in nsresult
error); void handleresult(in nsicontentpref pref); constants constant value description complete_ok 0 complete_
error 1 methods handlecompletion() called when the method finishes.
... handle
error() called when an
error occurs.
...void handle
error( in nsresult
error ); parameters
error a number in components.results describing the
error.
nsIDNSService
speculative requests return
errors if prefetching is disabled by configuration.
...exceptions thrown ns_
error_unknown_host if host could not be resolved.
.../dns-service;1"] .createinstance(components.interfaces.nsidnsservice); let thread = components.classes["@mozilla.org/thread-manager;1"] .getservice(components.interfaces.nsithreadmanager).currentthread; let host = "www.mozilla.org"; let listener = { onlookupcomplete: function(request, record, status) { if (!components.issuccesscode(status)) { // handle
error here return; } let address = record.getnextaddrasstring(); console.log(host + " = " + address); } }; dnsservice.asyncresolve(host, 0, listener, thread); ...
nsIDOMHTMLAudioElement
exceptions thrown ns_
error_dom_invalid_state_err the stream has not been initialized for writing by a call to mozsetup().
... ns_
error_dom_type_mismatch_err the data isn't a valid data type (an array or typed array of numeric values).
... ns_
error_dom_index_size_err the number of samples specified doesn't divide evenly across the number of channels; you must provide exactly the same number of samples for all channels.
nsIException
this is the location that caused the
error, which may or may not be a source file location.
... for example, standard language
errors would generally have the same location as their top stack entry.
... name string the name of the
error code (a string representation of result) read only.
nsIFocusManager
setting this to null or to a non-top-level window throws an ns_
error_invalid_arg exception.
...void clearfocus( in nsidomwindow awindow ); parameters awindow exceptions thrown ns_
error_invalid_arg if awindow is null.
...exceptions thrown ns_
error_invalid_arg if awindow is null.
nsIGlobalHistory3
implementors who wish to implement this interface but rely on nsiglobalhistory2.adduri() for redirect processing may throw ns_
error_not_implemented from this method.
... if they do so, then callers must call nsiglobalhistory2.adduri() upon getting the ns_
error_not_implemented result.
...not all histories have them; this need not be supported (just return ns_
error_not_implemented.
nsIIOService
exceptions thrown ns_
error_malformed_uri if url string is not of the right form.
...but less
error prone is to just supply a loadingnode.
... exceptions thrown ns_
error_malformed_uri if uri does not begin with a valid scheme (as defined by rfc 3986) followed by a colon.
nsIMicrosummaryObserver
1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void oncontentloaded(in nsimicrosummary microsummary); void onelementappended(in nsimicrosummary microsummary); void on
error(in nsimicrosummary microsummary); methods oncontentloaded() called when an observed microsummary updates its content.
... on
error() called when an observed microsummary encounters an
error during an update.
... void on
error( in nsimicrosummary microsummary ); parameters microsummary the microsumary which could not be updated.
nsIMsgDatabase
exceptions thrown ns_
error_file_target_does_not_exist afoldername doesn't exist and acreate was false.
... ns_msg_
error_folder_summary_out_of_date the database is present (and was opened), but the summary file is out of date.
... ns_msg_
error_folder_summary_missing the database is present (and was opened), but the summary file is missing.
nsINavHistoryObserver
if an
error occurs in between these two steps (for example, an out of memory
error), then you may get a notification even though the page doesn't wind up getting deleted.
...if an
error occurs in between these two steps (for example, an out of memory
error), then you may get a notification even though the page doesn't wind up getting deleted.
...queryinterface: function(iid) { if (iid.equals(ci.nsinavhistoryobserver) || iid.equals(ci.nsinavhistoryobserver_mozilla_1_9_1_additions) || iid.equals(ci.nsisupports)) { return this; } throw cr.ns_
error_no_interface; } see also nsinavhistoryresult ...
nsIOutputStream
ns_
error_not_implemented indicates that the stream does not implement this method.
...this method is expected to keep calling the reader until either there is nothing left to write or the reader returns an
error.
... ns_
error_not_implemented indicates that the stream does not have an internal buffer that can be written to directly.
nsIPushService
la.org/scriptsecuritymanager;1"] .getservice(ci.nsiscriptsecuritymanager); const pushservice = cc["@mozilla.org/push/service;1"] .getservice(ci.nsipushservice); pushservice.subscribe( "chrome://my-module/push", scriptsecuritymanager.getsystemprincipal(), (code, subscription) => { if (!components.issuccesscode(code)) { cu.report
error("
error creating subscription: " + code); return; } // `subscription` implements `nsipushsubscription`.
... example pushservice.getsubscription( "chrome://my-module/push", scriptsecuritymanager.getsystemprincipal(), (code, subscription) => { if (!components.issuccesscode(code)) { cu.report
error("
error fetching subscription: " + code); return; } // `subscription == null` if the `(scope, principal)` pair doesn't have a // push subscription.
... example pushservice.unsubscribe( "chrome://my-module/push", scriptsecuritymanager.getsystemprincipal(), (code, ok) => { if (!components.issuccesscode(code)) { cu.report
error("
error unsubscribing: " + code); return; } // `ok === true` if the subscription was removed, or `false` if the // `(scope, principal)` pair didn't have a subscription.
nsIRequest
status nsresult the
error status associated with the request.
...users should normally pass ns_binding_aborted, although other
errors may also be passed.
... the
error passed in will become the value of the status attribute.
nsISessionStore
exceptions thrown this method throws a ns_
error_illegal_value exception if the key doesn't exist.
... return value exceptions thrown ns_
error_invalid_arg when aindex does not map to a closed window.
...check with canrestorelastsession first to avoid thrown
errors.
nsISocketTransport
this object supports nsibadcertlistener2 and nsissl
errorlistener for ssl connections, and possibly other interfaces.
... nsitransporteventsink status codes note: although these constants look like xpcom
error codes and are passed in an nsresult variable, they are not
error codes.
... they do overlap with existing
error codes in necko, these status codes are confined within a very limited context where no
error codes may appear, so there is no ambiguity.
nsIThread
exceptions thrown ns_
error_unexpected shutdown() was erroneously called from within the thread itself, the thread was not created with the thread manager's nsithreadmanager.newthread() method, or the thread is already in the process of being shut down.
... exceptions thrown ns_
error_unexpected the method was called when this thread wasn't the current thread.
... exceptions thrown ns_
error_unexpected this method was called when this thread wasn't the current thread.
nsIURIFixup
exceptions thrown ns_
error_unknown_protocol when we can not get a protocol handler service for the uri scheme.
... ns_
error_malformed_uri when the exposable portion of auri is malformed.
... createfixupuri() converts the specified string into a uri, first attempting to correct any
errors in the syntax or other vagaries.
nsIWifiListener
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void onchange([array, size_is(alen)] in nsiwifiaccesspoint accesspoints, in unsigned long alen); void on
error(in long
error); methods onchange() called when the list of available access points changes.
... on
error() called when an
error occurs while updating the wifi access point list.
... void on
error( in long
error ); parameters
error the nsresult value indicating the
error that occurred.
nsIXMLHttpRequest
using event handlers from native code (not sure if it's up-to-date) from native code, the way to set up onload and on
error handlers is a bit different.
...the 'onload', 'on
error', and 'onreadystatechange' attributes moved to nsijsxmlhttprequest, but if you're coding in c++ you should avoid using those.
.../xmlextras/xmlhttprequest;1"].createinstance(ci.nsixmlhttprequest); let handler = ev => { evf(m => xhr.removeeventlistener(m, handler, !1)); switch (ev.type) { case 'load': if (xhr.status == 200) { cb(xhr.response); break; } default: services.prompt.alert(null, 'xhr
error', '
error fetching package: ' + xhr.statustext + ' [' + ev.type + ':' + xhr.status + ']'); break; } }; let evf = f => ['load', '
error', 'abort'].foreach(f); evf(m => xhr.addeventlistener(m, handler, false)); xhr.mozbackgroundrequest = true; xhr.open('get', url, true); xhr.channel.loadflags |= ci.nsirequest.load_anonymous | ci.nsirequest.load_bypass...
nsIXMLHttpRequestEventTarget
on
error nsidomeventlistener a javascript function object that gets invoked if the operation fails to complete due to an
error.
... onloadend nsidomeventlistener a javascript function object that gets invoked when the operation is completed for any reason; it will always follow a an abort,
error, or load event.
... onprogress nsidomeventlistener a javascript function object that gets invoked zero or more times, after the loadstart event, but before any abort,
error, or load events occur.
nsIXPConnect
returns: success: ns_ok failure: ns_
error_xpc_bad_convert_js ns_
error_failure.
... returns: success: ns_ok failure: ns_
error_xpc_bad_convert_js ns_
error_failure.
... returns: success: ns_ok failure: ns_
error_xpc_bad_convert_native ns_
error_xpc_cant_get_jsobject_of_dom_object ns_
error_failure.
nsIXULRuntime
logconsole
errors boolean whether to write console
errors to a log file.
... if a component encounters startup
errors that might prevent the app from showing proper ui, it should set this flag to true.
... may throw ns_
error_not_available.
nsIZipReader
subsequent attempts to extract() files or read from its input stream will result in an
error.
... exceptions thrown ns_
error_illegal_value on many but not all invalid apattern values.
...tstream(entrypointer); reusablestreaminstance.init(inputstream); var filecontents = reusablestreaminstance.read(entry.realsize); console.log('contenst of file=', filecontents); } else { console.log('is directory, no stream to read'); } } } catch (ex) { console.warn('exception occured = ', ex); if (ex.name == 'ns_
error_file_not_found') { services.ww.activewindow.alert('xpi at path does not exist!\n\npath = ' + pathtoxpitoread); } } finally { zr.close(); console.log('zr closed'); } see also nsizipentry nsizipwriter ...
XPCOM Interface Reference by grouping
browser autocomplete nsiautocompletecontroller nsiautocompleteinput nsiautocompletesearch console nsiconsolelistener nsiconsolemessage nsiconsoleservice document nsidocshell dom device nsidomgeogeolocation nsidomgeoposition nsidomgeopositionaddress nsidomgeopositioncallback nsidomgeopositioncoords nsidomgeoposition
error nsidomgeoposition
errorcallback nsidomgeopositionoptions nsidomglobalpropertyinitializer element nsidomchromewindow nsidomclientrect nsidomelement nsidomhtmlaudioelement nsidomhtmlformelement nsidomhtmlmediaelement nsidomhtmlsourceelement nsidomhtmltimeranges nsidomjswindow nsidomnode nsidomnshtmldocument nsidomstorageitem nsi...
...cessibleimage nsiaccessibleprovider nsiaccessibleretrieval nsiaccessiblerole nsiaccessiblescrolltype nsiaccessibleselectable nsiaccessiblestates nsiaccessibletable nsiaccessibletext nsiaccessibletreecache nsiaccessiblevalue nsiaccessnode nsisyncmessagesender script nsiscriptableunescapehtml nsiscriptableunicodeconverter nsiscript
error nsiscript
error2 stylesheet nsistylesheetservice url nsiuri nsiurl util nsidomserializer nsidomxpathevaluator nsidomxpathexception nsidomxpathexpression nsidomxpathresult xslt nsixsltexception nsixsltprocessor download nsidownload nsidownloadmanager nsidownloadprogresslistener element internal ...
...okiepromptservice nsicookieservice nsicookiestorage nsisessionstore crypto nsicryptohash filter nsiparentalcontrolsservice nsipermission nsipermissionmanager nsisecuritycheckedcomponent ssl nsissl
errorlistener stream stream nsipipe nsitraceablechannel nsitransport nsitransporteventsink nsitransportsecurityinfo timer nsitimer nsitimercallback ui windows nsitaskbarprev...
Storage
check for
errors.
... after you create and bind a statement, your javascript should look something like this to execute a statement asynchronously: statement.executeasync({ handleresult: function(aresultset) { for (let row = aresultset.getnextrow(); row; row = aresultset.getnextrow()) { let value = row.getresultbyname("column_name"); } }, handle
error: function(a
error) { print("
error: " + a
error.message); }, handlecompletion: function(areason) { if (areason != components.interfaces.mozistoragestatementcallback.reason_finished) print("query canceled or aborted!"); } }); the call to executeasync takes an object that implements mozistoragestatementcallback.
... if we encounter an
error, the transaction will // be rolled back.
Frequently Asked Questions
buildtime
errors the build just broke.
... it's not in your code, or it's not on your platform, but there's an nscomptr on the line where the
error is and you're suspicious.
... comparing an nscomptr to a raw xpcom interface pointer declaring an nscomptr to a forward-declared class not linking to xpcom not including nscomptr.h different settings of nscap_feature_debug_ptr_types runtime
errors ns_assertion "queryinterface needed" may be caused by a class that derives from a given interface, when you forgetting to also specify the interface name in the ns_impl_isupports / ns_impl_threadsafe_isupports macro.
Working with Multiple Versions of Interfaces
what happens is that the call to do_createinstance fails with nsresult ns_
error_no_interface.
... this is because the call to do_createinstance(acid, aouter,
error); will eventually evolve into a request for an object supporting the interface with iid ns_get_iid(nsiaccessibleretrieval).
... and this explains our ns_
error_no_interface.
Xray vision
xrays for javascript objects until recently, built-in javascript objects that are not part of the dom, such as date,
error, and object, did not get xray vision when accessed by more-privileged code.
...it will usually be created as a property of a dom object, and then it will be filtered out by the dom xray: // content code // redefine date.getfullyear() date.prototype.getfullyear = function() {return 1000}; var date = new date(); // chrome code // contentwindow is an xray, and date is an expando on contentwindow // so date is filtered out gbrowser.contentwindow.date.getfullyear() // -> type
error: gbrowser.contentwindow.date is undefined the chrome code will only even see date if it waives xrays, and then, because waiving is transitive, it should expect to be vulnerable to redefinition: // chrome code components.utils.waivexrays(gbrowser.contentwindow).date.getfullyear(); // -> 1000 however, there are some situations in which privileged code will access javascript objects that are not...
...d // 6) accessing a value property of a value-property object is fine console.log("6) value property of a value-property object"); console.log(sandbox.me.address.street); // -> "main street" // 7) functions defined on the sandbox-defined object are not visible in the xray console.log("7) call a function defined on the object"); try { console.log(sandbox.me.fullname()); } catch (e) { console.
error(e); } // -> type
error: sandbox.me.fullname is not a function // now with waived xrays console.log("now with waived xrays"); console.log("1) property redefined in the prototype:"); console.log(components.utils.waivexrays(sandbox.me).tosource()); // -> "not what you expected?" console.log("2) property that shadows the prototype:"); console.log(components.utils.waivexrays(sandbox.me).constructor)...
Testing Mozilla code
asan nightly projectthe asan nightly project involves building a firefox nightly browser with the popular addresssanitizer tool and enhancing it with remote crash reporting capabilities for any
errors detected.clang static analysisthis document is split in two parts.
... the first part will focus on the modern and robust way of static-analysis and the second part will present the build-time static-analysis.debugging mozilla with valgrindthis page describes how to use valgrind (specifically, its memcheck tool) to find memory
errors.firefox and address sanitizeraddress sanitizer (asan) is a fast memory
error detector that detects use-after-free and out-of-bound bugs in c/c++ programs.
...this type of coverage is only concerned with hit counts for lines and branches.the valgrind test jobthe valgrind test job builds the browser and runs it under valgrind, which can detect various common memory-related
errors.
Address book sync client design
add // if it's new, mod if it's been modified, // ret if it was already sent to the server // but an
error occured, etc.
... * * atransactionid - the id for this particular request * astatus - status code for the sync request * amsg - a text string describing the
error (if any).
... * * atransactionid - the id for this particular request * astatus - status code for the sync request * amsg - a text string describing the
error (if any).
Declaring and Using Callbacks
the return type of the javascript callback must match the return type declared, otherwise js-ctypes will throw an
error saying "unexpected return type".
... var myfunctypedeclaration = ctypes.functiontype(ctypes.default_abi, ctypes.bool, [ctypes.int, ctypes.voidptr_t]); function myjscallback(cint, cptr) { return true; // as the return of the functiontype was ctypes.bool we must make our javascript callback return bool otherwise js-ctypes will throw
error saying unexpected type return } var myccallback = myfunctypedeclaration.ptr(myjscallback); example 2 this callback that returns void and no arguments.
... var myfunctypedeclaration = ctypes.functiontype(ctypes.default_abi, ctypes.void_t, []); function myjscallback() { return undefined; // as the return of the functiontype was ctypes.void_t we must return undefined or dont return at all otherwise js-ctypes will throw an
error saying unexpected type } var myccallback = myfunctypedeclaration.ptr(myjscallback); using callbacks since callbacks are function pointers in c, js-ctypes has special handling for function pointer types.
PointerType
exceptions thrown type
error thrown if the parameter isn't a ctype.
...if converting the data fails, a type
error exception is thrown.
...this will throw a type
error exception if the value can't be converted.
Debugger.Memory - Firefox Developer Tools
assignment is fallible: if the debugger cannot track allocation sites, it throws an
error instance.
...the owning debugger’s uncaughtexceptionhandler is still fired for
errors thrown in debugger.memory hooks.
...any value assigned to a debugging handler must be either a function or undefined; otherwise a type
error is thrown.
ANGLE_instanced_arrays.drawArraysInstancedANGLE() - Web APIs
exceptions if mode is not one of the accepted values, a gl.invalid_enum
error is thrown.
... if first, count or primcount are negative, a gl.invalid_value
error is thrown.
... if gl.current_program is null, a gl.invalid_operation
error is thrown.
ANGLE_instanced_arrays.drawElementsInstancedANGLE() - Web APIs
exceptions if mode is not one of the accepted values, a gl.invalid_enum
error is thrown.
... if offset is a invalid multiple of the size of the given type, a gl.invalid_operation
error is thrown.
... if count or primcount are negative, a gl.invalid_value
error is thrown.
BaseAudioContext.decodeAudioData() - Web APIs
syntax older callback syntax: baseaudiocontext.decodeaudiodata(arraybuffer, successcallback,
errorcallback); newer promise-based syntax: promise<decodeddata> baseaudiocontext.decodeaudiodata(arraybuffer); parameters arraybuffer an arraybuffer containing the audio data to be decoded, usually grabbed from xmlhttprequest, windoworworkerglobalscope.fetch() or filereader.
...
errorcallback an optional
error callback, to be invoked if an
error occurs when the audio data is being decoded.
...ar request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { source.buffer = buffer; source.connect(audioctx.destination); source.loop = true; }, function(e){ console.log("
error with decoding audio data" + e.err); }); } request.send(); } // wire up buttons to stop and play audio play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); } stop.onclick = function() { source.stop(0); play.removeattribute('disabled'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; new promise-based syntax c...
BroadcastChannel - Web APIs
broadcastchannel.onmessage
error an eventhandler called when a messageevent of type message
error is fired—that is, when it receives a message that cannot be deserialized.
... message
error fired when a message arrives that can't be deserialized.
... also available via the onmessage
error property.
CSS.registerProperty() - Web APIs
exceptions invalidmodification
error the given name has already been registered.
... syntax
error the given name isn't a valid custom property name (starts with two dashes, e.g.
... type
error the required name and/or inherits dictionary members were not provided.
CanvasRenderingContext2D.getImageData() - Web APIs
exceptions indexsize
error thrown if either sw or sh are zero.
... security
error the canvas contains or may contain pixels which were loaded from an origin other than the one from which the document itself was loaded.
... to avoid security
error being thrown in this situation, configure cors to allow the source image to be used in this way.
ClipboardItem.getType() - Web APIs
the gettype() method of the clipboarditem interface returns a promise that resolves with a blob of the requested mime type or an
error if the mime type is not found.
... type
error no parameter is specified or the type is not that of the clipboarditem.
... async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.
error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification.
ClipboardItem - Web APIs
gettype() returns a promise that resolves with a blob of the requested mime type, or an
error if the mime type is not found.
... async function writeclipimg() { try { const imgurl = '/myimage.png'; const data = await fetch(imgurl); const blob = await data.blob(); await navigator.clipboard.write([ new clipboarditem({ [blob.type]: blob }) ]); console.log('fetched image copied.'); } catch(err) { console.
error(err.name, err.message); } } reading from the clipboard here we're returning all items on the clipboard via the clipboard.read() method.
... async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.
error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification.
console.assert() - Web APIs
the console.assert() method writes an
error message to the console if the assertion is false.
... examples the following code example demonstrates the use of a javascript object following the assertion: const
errormsg = 'the # is not even'; for (let number = 2; number <= 5; number += 1) { console.log('the # is ' + number); console.assert(number % 2 === 0, {number: number,
errormsg:
errormsg}); // or, using es2015 object property shorthand: // console.assert(number % 2 === 0, {number,
errormsg}); } // output: // the # is 2 // the # is 3 // assertion failed: {number: 3,
errormsg: "the # is not...
... even"} // the # is 4 // the # is 5 // assertion failed: {number: 5,
errormsg: "the # is not even"} note that, while a string containing a substitution string works as a parameter for console.log in node and many, if not most, browsers...
console - Web APIs
console.
error() outputs an
error message.
... console.exception() an alias for
error().
...there are four categories of output you can generate, using the console.log(), console.info(), console.warn(), and console.
error() methods respectively.
DOMMatrixReadOnly - Web APIs
throws an invalidstate
error exception if any of the elements in the matrix are non-finite (even if, in the case of a 2d matrix, the non-finite values are in elements not used by the 2d matrix representation).
...otherwise, a type
error exception is thrown.
...otherwise, a type
error exception is thrown.
DOMParser - Web APIs
ldocument application/xml xmldocument application/xhtml+xml xmldocument image/svg+xml xmldocument examples parsing xml once you have created a parser object, you can parse xml from a string using the parsefromstring() method: let parser = new domparser() let doc = parser.parsefromstring(stringcontainingxmlsource, "application/xml")
error handling note that if the parsing process fails, the domparser does not throw an exception, but instead returns an
error document: <parser
error xmlns="http://www.mozilla.org/newlayout/xml/parser
error.xml"> (
error description) <sourcetext>(a snippet of the source xml)</sourcetext> </parser
error> the parsing
errors are also reported to the
error console, with the document uri (see below) as...
... the source of the
error.
...@source https://gist.github.com/1129031 */ /*global document, domparser*/ (function(domparser) { "use strict"; var proto = domparser.prototype, nativeparse = proto.parsefromstring; // firefox/opera/ie throw
errors on unsupported types try { // webkit returns null on unsupported types if ((new domparser()).parsefromstring("", "text/html")) { // text/html parsing is natively supported return; } } catch (ex) {} proto.parsefromstring = function(markup, type) { if (/^\s*text\/html\s*(?:;|$)/i.test(type)) { var doc = document.implementation.createhtmldocument(""); if (markup.tolowercase...
DedicatedWorkerGlobalScope - Web APIs
from the worker.postmessage method.) dedicatedworkerglobalscope.onmessage
error is an eventhandler representing the code to be called when the message
error event is raised.
... message
error fired when a worker receives a message that can't be deserialized.
... also available via the onmessage
error property.
DirectoryReaderSync - Web APIs
if (entry.isdirectory) { getallentries(entry.createreader()); } } } // forward the
error to main app.
... function on
error(e) { postmessage('
error: ' + e.tostring()); } self.onmessage = function(e) { var data = e.data; // ignore everything else except our 'list' command.
... if (!data.cmd || data.cmd != 'list') { return; } try { var fs = requestfilesystemsync(temporary, 1024*1024 /*1mb*/); getallentries(fs.root.createreader()); self.postmessage({entries: paths}); } catch (e) { on
error(e); } }; method overview entrysync readentries () raises (fileexception); method readentries() returns a lost of entries from a specific directory.
Document.write() - Web APIs
for example: <script> document.write("<h1>main title</h1>") </script> note: document.write() and document.writeln do not work in xhtml documents (you'll get an "operation is not supported" [ns_
error_dom_not_supported_err]
error in the
error console).
... note: using document.write() in deferred or asynchronous scripts will be ignored and you'll get a message like "a call to document.write() from an asynchronously-loaded external script was ignored" in the
error console.
... note: in edge only, calling document.write() more than once in an <iframe> causes the
error "script70: permission denied".
Element.classList - Web APIs
string.prototype.trim polyfill if (!"".trim) string.prototype.trim = function(){ return this.replace(/^[\s]+|[\s]+$/g, ''); }; (function(window){"use strict"; // prevent global namespace pollution if(!window.domexception) (domexception = function(reason){this.message = reason}).prototype = new
error; var wsre = /[\11\12\14\15\40]/, wsindex = 0, checkifvalidclasslistentry = function(o, v) { if (v === "") throw new domexception( "failed to execute '" + o + "' on 'domtokenlist': the token provided must not be empty." ); if((wsindex=v.search(wsre))!==-1) throw new domexception("failed to execute '"+o+"' on 'domtokenlist': " + "the token provided ('"+v[wsindex]+"') contains html space...
...plement the barebones domtokenlist livelyness polyfill if (typeof domtokenlist !== "function") (function(window){ var document = window.document, object = window.object, hasownprop = object.prototype.hasownproperty; var defineproperty = object.defineproperty, allowtokenlistconstruction = 0, skippropchange = 0; function domtokenlist(){ if (!allowtokenlistconstruction) throw type
error("illegal constructor"); // internally let it through } domtokenlist.prototype.tostring = domtokenlist.prototype.tolocalestring = function(){return this.value}; domtokenlist.prototype.add = function(){ a: for(var v=0, arglen=arguments.length,val="",ele=this[" ucl"],proto=ele[" uclp"]; v!==arglen; ++v) { val = arguments[v] + "", checkifvalidclasslistentry("add", val)...
...var i=clen-sub; i < oldlen; ++i) delete restokenlist[i]; //remove trailing indexs if(prop !== "classlist") return; skippropchange = 1, target.classlist = restokenlist, target.classname = strval; skippropchange = 0, restokenlist.length = tokens.length - sub; } } function polyfillclasslist(ele){ if (!ele || !("innerhtml" in ele)) throw type
error("illegal invocation"); ele.detachevent( "onpropertychange", whenpropchanges ); // prevent duplicate handler infinite loop allowtokenlistconstruction = 1; try{ function protoobj(){} protoobj.prototype = new domtokenlist(); } finally { allowtokenlistconstruction = 0 } var protoobjproto = protoobj.prototype, restokenlist = new protoobj(); a: for(var to...
Element.innerHTML - Web APIs
exceptions syntax
error an attempt was made to set the value of innerhtml using a string which is not properly-formed html.
... nomodificationallowed
error an attempt was made to insert the html into a node whose parent is a document.
...for example: const name = "<img src='x' on
error='alert(1)'>"; el.innerhtml = name; // shows the alert for that reason, it is recommended that you do not use innerhtml when inserting plain text; instead, use node.textcontent.
FetchEvent.request - Web APIs
note that an http
error response (e.g., 404) will not trigger an exception.
... it will return a normal response object that has the appropriate
error code set.
...about to fetch from network...'); return fetch(event.request).then(function(response) { console.log('response from network is:', response); return response; }).catch(function(
error) { console.
error('fetching failed:',
error); throw
error; }); }) ); }); specifications specification status comment service workersthe definition of 'request' in that specification.
FetchEvent.respondWith() - Web APIs
otherwise, a network
error is returned to fetch.
... exceptions exception notes network
error a network
error is triggered on certain combinations of fetchevent.request.mode and response.type values, as hinted at in the "global rules" listed above.
... invalidstate
error the event has not been dispatched or respondwithwith() has already been invoked.
FileSystemDirectoryReader.readEntries() - Web APIs
syntax readentries(successcallback[,
errorcallback]); parameters successcallback a function which is called when the directory's contents have been retrieved.
...
errorcallback optional a callback function which is called if an
error occurs while reading from the directory.
... it receives one input parameter: a file
error object describing the
error which occurred.
Guide to the Fullscreen API - Web APIs
instead, the element which requested fullscreen will receive a mozfullscreen
error event.
... when a fullscreen request fails, firefox will log an
error message to the web console explaining why the request failed.
...n mozfullscreen - document.fullscreenenabled webkitfullscreenenabled mozfullscreenenabled msfullscreenenabled documentorshadowroot.fullscreenelement webkitfullscreenelement mozfullscreenelement msfullscreenelement document.onfullscreenchange onwebkitfullscreenchange onmozfullscreenchange onmsfullscreenchange document.onfullscreen
error onwebkitfullscreen
error onmozfullscreen
error onmsfullscreen
error document.exitfullscreen() webkitexitfullscreen() mozcancelfullscreen() msexitfullscreen() element.requestfullscreen() webkitrequestfullscreen() mozrequestfullscreen() msrequestfullscreen() specifications specification status comment fullscreen api li...
Geolocation API - Web APIs
an optional
error callback: if the location retrieval is unsuccessful, the callback executes with a geolocationposition
error object as its only parameter, providing access information on what went wrong.
... geolocationposition
error a geolocationposition
error is returned by an unsuccessful call to one of the methods contained inside geolocation, inside an
error callback, and contains an
error code and message.
...link'); maplink.href = ''; maplink.textcontent = ''; function success(position) { const latitude = position.coords.latitude; const longitude = position.coords.longitude; status.textcontent = ''; maplink.href = `https://www.openstreetmap.org/#map=18/${latitude}/${longitude}`; maplink.textcontent = `latitude: ${latitude} °, longitude: ${longitude} °`; } function
error() { status.textcontent = 'unable to retrieve your location'; } if(!navigator.geolocation) { status.textcontent = 'geolocation is not supported by your browser'; } else { status.textcontent = 'locating…'; navigator.geolocation.getcurrentposition(success,
error); } } document.queryselector('#find-me').addeventlistener('click', geofindme); result specifications ...
GlobalEventHandlers - Web APIs
globaleventhandlers.on
error is an on
erroreventhandler representing the code to be called when the
error event is raised.
... globaleventhandlers.onpointerlock
error is an eventhandler representing the code to be called when the pointerlock
error event is raised.
... candidate recommendation adds onpointerlockchange and onpointerlock
error on document.
HTMLBodyElement - Web APIs
windoweventhandlers.onmessage
error is an eventhandler called whenever an object receives a message
error event.
... living standard technically, the event-related properties onafterprint, onbeforeprint, onbeforeunload, onblur, on
error, onfocus, onhashchange, onlanguagechange, onload, onmessage, onoffline, ononline, onpopstate, onresize, onstorage, and onunload, have been moved to windoweventhandlers.
... the following properties have been added: onafterprint, onbeforeprint, onbeforeunload, onblur, on
error, onfocus, onhashchange, onload, onmessage, onoffline, ononline, onpopstate, onresize, onstorage, and onunload.
HTMLImageElement.decode() - Web APIs
exceptions encoding
error a domexception indicating that an
error occurred while decoding the image.
...without a promise-returning method, you would add the image to the dom in a load event handler, such as by using the img.onload event handler, and by handling the
error in the
error event's handler.
... const img = new image(); img.src = 'nebula.jpg'; img.decode() .then(() => { document.body.appendchild(img); }) .catch((encoding
error) => { // do something with the
error.
HTMLMediaElement.play() - Web APIs
possible
errors include: notallowed
error the user agent (browser) or operating system doesn't allow playback of media in the current context or situation.
... notsupported
error the media source (which may be specified as a mediastream, mediasource, blob, or file, for example) doesn't represent a supported media format.
... if the user agent is configured not to allow automatic or script-initiated playback of media, calling play() will cause the returned promise to be immediately rejected with a notallowed
error.
HTMLMediaElement - Web APIs
htmlmediaelement.
error read only returns a media
error object for the most recent
error, or null if there has not been an
error.
... abort fired when the resource was not fully loaded, but not as the result of an
error.
...
error fired when the resource could not be loaded due to an
error.
HTMLTrackElement - Web APIs
loading 1 indicates that the text track is loading and there have been no fatal
errors encountered so far.
... loaded 2 indicates that the text track has been loaded with no fatal
errors.
...
error 3 indicates that the text track was enabled, but when the user agent attempted to obtain it, this failed in some way.
IDBCursor.advance() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbcursor's transaction is inactive.
... type
error the value passed into the count parameter was zero or a negative number.
... invalidstate
error the cursor is currently being iterated or has iterated past its end.
IDBCursor.continue() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbcursor's transaction is inactive.
... data
error the key parameter may have any of the following conditions: the key is not a valid key.
... invalidstate
error the cursor is currently being iterated or has iterated past its end.
IDBCursor.delete() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbcursor's transaction is inactive.
... readonly
error the transaction mode is read-only.
... invalidstate
error the cursor was created using idbindex.openkeycursor, is currently being iterated, or has iterated past its end.
IDBDatabase.deleteObjectStore() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstate
error occurs if the method was not called from a versionchange transaction callback.
... transactioninactive
error occurs if a request is made on a source database that doesn't exist (e.g.
... has been deleted or removed.) in firefox previous to version 41, an invalidstate
error was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) notfound
error you are trying to delete an object store that does not exist.
databases - Web APIs
return value a promise that resolves either to an
error or a list of dictionaries, each with two elements, name and version.
... exceptions this method may raise a domexception of the following types: attribute description security
error the method is called from an opaque origin.
... other
error specification does not describe all possible
errors.
IDBIndex.count() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbindex's transaction is inactive.
... data
error the key or key range provided contains an invalid key.
... invalidstate
error the idbindex has been deleted or removed.
IDBIndex.get() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbindex's transaction is inactive.
... data
error the key or key range provided contains an invalid key.
... invalidstate
error the idbindex has been deleted or removed.
IDBIndex.getKey() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbindex's transaction is inactive.
... data
error the key or key range provided contains an invalid key.
... invalidstate
error the idbindex has been deleted or removed.
IDBIndex.name - Web APIs
invalidstate
error the index, or its object store, has been deleted; or the current transaction is not an upgrade transaction.
... transactioninactive
error the current transaction is not active.
... constraint
error an index is already using the specified name.
IDBObjectStore.clear() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description readonly
error the transaction associated with this operation is in read-only mode.
... transactioninactive
error this idbobjectstore's transaction is inactive.
...orm the object store cleardata(); }; function cleardata() { // open a read/write db transaction, ready for clearing the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.on
error = function(event) { note.innerhtml += '<li>transaction not opened due to
error: ' + transaction.
error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // make a request to clear all the data out of the object store var objectstorerequest = objectstore.clear(); objectstorerequest.onsuccess = function(event) { /...
IDBObjectStore.count() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstate
error this idbobjectstore has been deleted.
... transactioninactive
error this idbobjectstore's transaction is inactive.
... data
error the specified key or key range is invalid.
IDBObjectStore.getKey() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactive
error this idbobjectstore's transaction is inactive.
... data
error the key or key range provided contains an invalid key.
... invalidstate
error the idbobjectstore has been deleted or removed.
IDBObjectStore.openCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstate
error this idbobjectstore or idbindex has been deleted.
... transactioninactive
error this idbobjectstore's transaction is inactive.
... data
error the specified key or key range is invalid.
IDBObjectStore.openKeyCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstate
error this idbobjectstore or idbindex has been deleted.
... transactioninactive
error this idbobjectstore's transaction is inactive.
... data
error the specified key or key range is invalid.
IDBTransaction.abort() - Web APIs
all pending idbrequest objects created during this transaction have their idbrequest.
error attribute set to abort
error.
... syntax transaction.abort(); exceptions this method may raise a domexception of the following type: exception description invalidstate
error the transaction has already been committed or aborted.
...ay: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.on
error = function(event) { note.innerhtml += '<li>transaction not opened due to
error.
IDBTransaction: abort event - Web APIs
bubbles yes cancelable no interface event event handler property onabort this can happen for any of the following reasons: bad requests, (for example, trying to add the same key twice, or put the same index key when the key has a uniqueness constraint), an explicit abort() call an uncaught exception in the request's success/
error handler, an i/o
error (an actual failure to write to disk, for example disk detached, or other os/hardware failure) quota exceeded.
... // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.on
error = () => { console.log('
error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false...
...t` transaction.addeventlistener('abort', () => { console.log('transaction was aborted'); }); // abort the transaction transaction.abort(); }; the same example, but assigning the event handler to the onabort property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.on
error = () => { console.log('
error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createinde...
IDBTransaction.commit() - Web APIs
if it is called on a transaction that is not active, it throws an invalidstate
error domexception.
... exceptions exception description invalidstate
error the transaction state is not active.
... examples // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["mydb"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.on
error = function(event) { note.innerhtml += '<li>transaction not opened due to
error.
IDBTransaction.objectStore() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description notfound
error the requested object store is not in this transaction's scope.
... invalidstate
error the request was made on a source object that has been deleted or removed, or if the transaction has finished.
...day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.on
error = function(event) { note.innerhtml += '<li>transaction not opened due to
error.
LocalFileSystemSync - Web APIs
example //taking care of the browser-specific prefix window.requestfilesystemsync = window.requestfilesystemsync || window.webkitrequestfilesystemsync; // the first parameter defines the type of storage: persistent or temporary // next, set the size of space needed (in bytes) // initfs is the success callback // and the last one is the
error callback // for denial of access and other
errors.
... var fs = requestfilesystemsync(temporary, 1024*1024 /*1mb*/); because you are using a synchronous api, you don't need success and
error callbacks.
... exceptions this method can raise an fileexception with the following code: exception description security_
error the application does not have permission to access the file system interface.
MediaStreamTrackAudioSourceNode() - Web APIs
exceptions notsupported
error the specified context is not an audiocontext.
... invalidstate
error the specified mediastreamtrack isn't an audio track (that is, its kind property isn't audio.
...etusermedia) { navigator.mediadevices.getusermedia ( { audio: true, video: false }).then(function(stream) { let options = { mediastreamtrack: stream.getaudiotracks()[0]; } let source = new mediastreamtrackaudiosourcenode(audioctx, options); source.connect(audioctx.destination); }).catch(function(err) { console.log('the following gum
error occured: ' + err); }); } else { console.log('new getusermedia not supported on your browser!'); } specifications specification status comment web audio apithe definition of 'mediastreamtrackaudiosourcenode()' in that specification.
MessagePort - Web APIs
onmessage
error an eventlistener called when a messageevent of type message
error is fired—that is, when it receives a message that cannot be deserialized.
... message
error fired when a messageport object receives a message that can't be deserialized.
... also available via the onmessage
error property.
NDEFReader.scan() - Web APIs
exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: abort
error the scan operation was aborted with abortsignal passed in options.
... notallowed
error the permission for this operation was rejected.
... notsupported
error there is no nfc adapter compatible with web nfc, or a connection can not be established.
Navigator.requestMediaKeySystemAccess() - Web APIs
the fulfillment handler receives as input just one parameter: mediakeysystemaccess a mediakeysystemaccess object representing the media key system configuration described by keysystem and supportedconfigurations exceptions in case of an
error, the returned promise is rejected with a domexception whose name indicates what kind of
error occurred.
... notsupported
error either the specified keysystem isn't supported by the platform or the browser, or none of the configurations specified by supportedconfigurations can be satisfied (if, for example, none of the codecs specified in contenttype are available).
... type
error either keysystem is an empty string or the supportedconfigurations array is empty.
OVR_multiview2.framebufferTextureMultiviewOVR() - Web APIs
exceptions a gl.invalid_enum
error is thrown if target is not gl.framebuffer.
... a gl.invalid_value
error is thrown if level is not 0.
... a gl.invalid_operation
error is thrown if texture isn't 0 or the name of an existing texture object.
PushManager.subscribe() - Web APIs
}, function(
error) { // during development it often helps to log
errors to the // console.
... in a production environment it might make sense to // also report information about
errors back to the // application server.
... console.log(
error); } ); }); responding to user gestures subscribe() calls should be done in response to a user gesture, such as clicking a button, for example: btn.addeventlistener('click', function() { serviceworkerregistration.pushmanager.subscribe(options) .then(function(pushsubscription) { // handle subscription }); }) this is not only best practice — you should not be spamming users with notifications they didn't agree to — but going forward browsers will explicitly disallow notifications not triggered in response to a user gesture.
PushManager - Web APIs
}, function(
error) { // during development it often helps to log
errors to the // console.
... in a production environment it might make sense to // also report information about
errors back to the // application server.
... console.log(
error); } ); }); specifications specification status comment push apithe definition of 'pushmanager' in that specification.
RTCDataChannel - Web APIs
for example, after rtcdatachannel.close() was called but the underlying data transport might not have been closed yet.on
error the rtcdatachannel.on
error property is an eventhandler which specifies a function to be called when the
error event is received.
... when an
error occurs on the data channel, the function receives as input an
errorevent object describing the
error which occurred.onmessage the rtcdatachannel.onmessage property stores an eventhandler which specifies a function to be called when the message event is fired on the channel.
...
error sent to the on
error event handler when an
error occurs on the data channel.
RTCPeerConnection.getStats() - Web APIs
exceptions this method does not throw exceptions; instead, it rejects the returned promise with one of the following
errors: invalidaccess
error there is no rtcrtpsender or rtcrtpreceiver whose track matches the specified selector, or selector matches more than one sender or receiver.
... failurecallback a function to call when an
error occurs while attempting to collect statistics.
... the callback receives as input the exception (a domexception object describing the
error which occurred.
RTCPeerConnection.peerIdentity - Web APIs
if an
error occcurs while attempting to validate an incoming identity assertion (that is, the information describing a peer's identity), the promise is rejected.
...if an
error occurs and the promise is rejected, this logs the
error to the console and returns null to the caller.
...*/ async function getidentityassertion(pc) { try { const identity = await pc.peeridentity; return identity; } catch(err) { console.log("
error identifying remote peer: ", err); return null; } } specifications specification status comment identity for webrtc candidate recommendation initial specification.
ReadableStreamBYOBReader.releaseLock() - Web APIs
if the associated stream is
errored when the lock is released, the reader will appear
errored in that same way subsequently; otherwise, the reader will appear closed.
...this will result in a type
error being thrown.
... exceptions type
error the source object is not a readablestreambyobreader, or a read request is pending.
ReadableStreamDefaultReader.releaseLock() - Web APIs
if the associated stream is
errored when the lock is released, the reader will appear
errored in that same way subsequently; otherwise, the reader will appear closed.
...this will result in a type
error being thrown.
... exceptions type
error the source object is not a readablestreamdefaultreader, or a read request is pending.
Request.cache - Web APIs
// in reality; this would be a function that takes a path and a // reference to the controller since it would need to change the value let controller = new abortcontroller(); fetch("some.json", {cache: "only-if-cached", mode: "same-origin", signal: controller.signal}) .catch(e => e instanceof type
error && e.message === "failed to fetch" ?
... ({status: 504}) : // workaround for chrome; which simply fails with a type
error promise.reject(e)) .then(res => { if (res.status === 504) { controller.abort() controller = new abortcontroller(); return fetch("some.json", {cache: "force-cache", mode: "same-origin", signal: controller.signal}) } const date = res.headers.get("date"), dt = date ?
... return res }) .then(function(response) { /* consume the (possibly stale) response */ }) .catch(
error => { /* can be an abort
error/dom
error or a type
error */ }); specifications specification status comment fetchthe definition of 'cache' in that specification.
Request - Web APIs
it may be one of follow,
error, or manual.
... you could then fetch this api request by passing the request object in as a parameter to a windoworworkerglobalscope.fetch() call, for example and get the response: fetch(request) .then(response => { if (response.status === 200) { return response.json(); } else { throw new
error('something went wrong on api server!'); } }) .then(response => { console.debug(response); // ...
... }).catch(
error => { console.
error(
error); }); specifications specification status comment fetchthe definition of 'request' in that specification.
ServiceWorkerContainer.register() - Web APIs
navigator.serviceworker.register('/sw.js').then(function(registration) { console.log('service worker registration succeeded:', registration); }, /*catch*/ function(
error) { console.log('service worker registration failed:',
error); }); } else { console.log('service workers are not supported.'); } the following code, if included in example.com/index.html, at the root of a site, would apply to exactly the same pages as the example above.
... if ('serviceworker' in navigator) { // declaring scope manually navigator.serviceworker.register('/sw.js', {scope: './'}).then(function(registration) { console.log('service worker registration succeeded:', registration); }, /*catch*/ function(
error) { console.log('service worker registration failed:',
error); }); } else { console.log('service workers are not supported.'); } there is frequent confusion surrounding the meaning and use of scope.
... if ('serviceworker' in navigator) { // declaring scope manually navigator.serviceworker.register('/sw.js', {scope: '/product/'}).then(function(registration) { console.log('service worker registration succeeded:', registration); }, /*catch*/ function(
error) { console.log('service worker registration failed:',
error); }); } else { console.log('service workers are not supported.'); } however, servers can remove this restriction by setting a service-worker-allowed header on the service worker script, and then you can specify a max scope for that service worker above the service worker's location.
ServiceWorkerContainer - Web APIs
error fired whenever an
error occurs in the associated service workers.
... also available via the serviceworkercontainer.on
error property.
...see /docs/web/api/serviceworkerregistration }).catch(function(
error) { console.log('service worker registration failed:',
error); }); // independent of the registration, let's also display // information about whether the current page is controlled // by an existing service worker, and when that // controller changes.
ServiceWorkerGlobalScope.onfetch - Web APIs
note that an http
error response (e.g., 404) will not trigger an exception.
... it will return a normal response object that has the appropriate
error code set.
...about to fetch from network...'); return fetch(event.request).then(function(response) { console.log('response from network is:', response); return response; }).catch(function(
error) { console.
error('fetching failed:',
error); throw
error; }); }) ); }); specifications specification status comment service workersthe definition of 'event handlers' in that specification.
ServiceWorkerGlobalScope - Web APIs
note that an http
error response (e.g., 404) will not trigger an exception.
... it will return a normal response object that has the appropriate
error code set.
...about to fetch from network...'); return fetch(event.request).then(function(response) { console.log('response from network is:', response); return response; }, function(
error) { console.
error('fetching failed:',
error); throw
error; }); }) ); }); specifications specification status comment service workersthe definition of 'serviceworkerglobalscope' in that specification.
ServiceWorkerRegistration.pushManager - Web APIs
}, function(
error) { // during development it often helps to log
errors to the // console.
... in a production environment it might make sense to // also report information about
errors back to the // application server.
... console.log(
error); } ); }); specifications specification status comment push apithe definition of 'pushmanager' in that specification.
SharedWorker() - Web APIs
exceptions a security
error is raised if the document is not allowed to start workers, for example if the url has an invalid syntax or if the same-origin policy is violated.
... a network
error is raised if the mime type of the worker script is incorrect.
... a syntax
error is raised if aurl cannot be parsed.
SourceBuffer.changeType() - Web APIs
exceptions type
error the specified string is empty, rather than indicating a valid mime type.
... invalidstate
error the sourcebuffer is not a member of the parent media source's sourcebuffers list, or the buffer's updating property indicates that a previously queued appendbuffer() or remove() is still being processed.
... notsupported
error the specified mime type is not supported, or is not supported with the types of sourcebuffer objects present in the mediasource.sourcebuffers list.
Using readable streams - Web APIs
controller.close(); return; } // enqueue the next data chunk into our target stream controller.enqueue(value); return pump(); }); } } }) }) .then(stream => new response(stream)) .then(response => response.blob()) .then(blob => url.createobjecturl(blob)) .then(url => console.log(image.src = url)) .catch(err => console.
error(err)); let’s look in detail at how read() is used.
... if the stream becomes
errored, the promise will be rejected with the relevant
error.
... .then(stream => new response(stream)) .then(response => response.blob()) .then(blob => url.createobjecturl(blob)) .then(url => console.log(image.src = url)) .catch(err => console.
error(err)); but a custom stream is still a readablestream instance, meaning you can attach a reader to it.
SubtleCrypto.decrypt() - Web APIs
exceptions the promise is rejected when the following exceptions are encountered: invalidaccess
error raised when the requested operation is not valid for the provided key (e.g.
... operation
error raised when the operation failed for an operation-specific reason (e.g.
... algorithm parameters of invalid sizes, or there was an
error decrypting the ciphertext).
SubtleCrypto.unwrapKey() - Web APIs
exceptions the promise is rejected when one of the following exceptions is encountered: invalidaccess
error raised when the unwrapping key is not a key for the requested unwrap algorithm or if the cryptokey.usages value of that key doesn't contain unwrap.
... syntax
error raised when keyusages is empty but the unwrapped key is of type secret or private.
... type
error raised when trying to use an invalid format.
URL() - Web APIs
if the given base url or the resulting url are not valid urls, the javascript type
error exception is thrown.
... exceptions exception explanation type
error url (in the case of absolute urls) or base + url (in the case of relative urls) is not a valid url.
...org/docs' new url('/docs', a); // => 'https://developer.mozilla.org/docs' new url('/docs', "https://developer.mozilla.org/fr-fr/toto"); // => 'https://developer.mozilla.org/docs' new url('/docs', ''); // raises a type
error exception as '' is not a valid url new url('/docs'); // raises a type
error exception as '/docs' is not a valid url new url('http://www.example.com', ); // => 'http://www.example.com/' new url('http://www.example.com', b); // => 'http://www.example.com/' new url("//foo.com", "https://example.com") // => 'https://foo.com'...
WebGL2RenderingContext.drawElementsInstanced() - Web APIs
exceptions if mode is not one of the accepted values, a gl.invalid_enum
error is thrown.
... if offset is a valid multiple of the size of the given type, a gl.invalid_operation
error is thrown.
... if count or instancecount are negative, a gl.invalid_value
error is thrown.
WebGL2RenderingContext.drawRangeElements() - Web APIs
exceptions if mode is not one of the accepted values, a gl.invalid_enum
error is thrown.
... if offset is a valid multiple of the size of the given type, a gl.invalid_operation
error is thrown.
... if count is negative, a gl.invalid_value
error is thrown.
WebGLRenderingContext.bufferData() - Web APIs
exceptions a gl.out_of_memory
error is thrown if the context is unable to create a data store with the given size.
... a gl.invalid_value
error is thrown if size is negative.
... a gl.invalid_enum
error is thrown if target or usage are not one of the allowed enums.
WebGLRenderingContext.drawArrays() - Web APIs
exceptions if mode is not one of the accepted values, a gl.invalid_enum
error is thrown.
... if first or count are negative, a gl.invalid_value
error is thrown.
... if gl.current_program is null, a gl.invalid_operation
error is thrown.
WebGLRenderingContext.drawElements() - Web APIs
exceptions if mode is not one of the accepted values, a gl.invalid_enum
error is thrown.
... if offset is not a valid multiple of the size of the given type, a gl.invalid_operation
error is thrown.
... if count is negative, a gl.invalid_value
error is thrown.
WebGLRenderingContext.framebufferRenderbuffer() - Web APIs
exceptions a gl.invalid_enum
error is thrown if target is not gl.framebuffer, gl.draw_framebuffer, or gl.read_framebuffer.
... a gl.invalid_enum
error is thrown if renderbuffertarget is not gl.renderbuffer.
... a gl.invalid_enum
error is thrown if attachment is not one of the allowed enums.
WebGLRenderingContext.framebufferTexture2D() - Web APIs
exceptions a gl.invalid_enum
error is thrown if target is not gl.framebuffer.
... a gl.invalid_value
error is thrown if level is not 0.
... a gl.invalid_operation
error is thrown if texture isn't 0 or the name of an existing texture object.
WebGLRenderingContext.makeXRCompatible() - Web APIs
exceptions this method doesn't throw traditional exceptions; instead, the promise rejects with one of the following
errors as the value passed into the rejection handler: abort
error switching the context over to the webxr-compatible context failed.
... invalidstate
error the webgl context has been lost or there is no available webxr device.
...*/ outputcanvas.addeventlistener("webglcontextrestored", (event) => { loadsceneresources(currentscene); }); async function onstartedxrsession(xrsession) { try { await gl.makexrcompatible(); } catch(err) { switch(err) { case abort
error: showsimplemessagebox("unable to transfer the game to your xr headset.", "cancel"); break; case invalidstate
error: showsimplemessagebox("you don't appear to have a compatible xr headset available.", "cancel"); break; default: handlefatal
error(err); break; } xrsession.end(); } } async function handlestartbuttonclick(event) { ...
WebGLRenderingContext.readPixels() - Web APIs
exceptions a gl.invalid_enum
error is thrown if format or type is not an accepted value.
... a gl.invalid_operation
error is thrown if type is gl.unsigned_short_5_6_5 and format is not gl.rgb.
... a gl.invalid_framebuffer_operation
error is thrown if the currently bound framebuffer is not framebuffer complete.
WebGL model view projection - Web APIs
the more operations that are done on larger numbers, the more and more
errors accumulate into the result.
... when dividing by w, this can effectively increase the precision of very large numbers by operating on two potentially smaller, less
error-prone numbers.
...this value should be kept reasonably close to the distance of the geometry in order to avoid precision
errors creeping in while rendering.
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
async function enablehold(audiostream) { try { await audiotransceiver.sender.replacetrack(audiostream.getaudiotracks()[0]); audiotransceiver.receiver.track.enabled = false; audiotransceiver.direction = "sendonly"; } catch(err) { /* handle the
error */ } } the three lines of code within the try block perform the following steps: replace their outgoing audio track with a mediastreamtrack containing hold music.
... async function holdrequested(offer) { try { await peerconnection.setremotedescription(offer); await audiotransceiver.sender.replacetrack(null); audiotransceiver.direction = "recvonly"; await sendanswer(); } catch(err) { /* handle the
error */ } } the steps taken here are: set the remote description to the specified offer by calling rtcpeerconnection.setremotedescription().
... remote peer when the "sendrecv" offer is received by the remote peer, it calls its holdended() method: async function holdended(offer, micstream) { try { await peerconnection.setremotedescription(offer); await audiotransceiver.sender.replacetrack(micstream.getaudiotracks()[0]); audiotransceiver.direction = "sendrecv"; await sendanswer(); } catch(err) { /* handle the
error */ } } the steps taken inside the try block here are: the received offer is stored as the remote description by calling setremotedescription().
A simple RTCDataChannel sample - Web APIs
localconnection.onicecandidate = e => !e.candidate || remoteconnection.addicecandidate(e.candidate) .catch(handleaddcandidate
error); remoteconnection.onicecandidate = e => !e.candidate || localconnection.addicecandidate(e.candidate) .catch(handleaddcandidate
error); we configure each rtcpeerconnection to have an event handler for the icecandidate event.
...teoffer() .then(offer => localconnection.setlocaldescription(offer)) .then(() => remoteconnection.setremotedescription(localconnection.localdescription)) .then(() => remoteconnection.createanswer()) .then(answer => remoteconnection.setlocaldescription(answer)) .then(() => localconnection.setremotedescription(remoteconnection.localdescription)) .catch(handlecreatedescription
error); let's go through this line by line and decipher what it means.
... the catch() calls a routine that handles any
errors that occur.
WebSocket - Web APIs
websocket.on
error an event listener to be called when an
error occurs.
... also available via the onclose property
error fired when a connection with a websocket has been closed because of an
error, such as when some data couldn't be sent.
... also available via the on
error property.
Writing WebSocket client applications - Web APIs
the constructor will throw a security
error if the destination doesn't allow access.
... connection
errors if an
error occurs while attempting to connect, first a simple event with the name
error is sent to the websocket object (thereby invoking its on
error handler), and then the closeevent is sent to the websocket object (thereby invoking its onclose handler) to indicate the reason for the connection's closing.
... the browser may also output to its console a more descriptive
error message as well as a closing code as defined in rfc 6455, section 7.4 through the closeevent.
Window.open() - Web APIs
note on position and dimension
error correction position if only one of them is specified, the behavior is implementation-dependent, and web author should not rely on it.
...i always get an
error in the javascript console saying "
error: uncaught exception: permission denied to get property <property_name or method_name>.
... protocol scheme "javascript:" will be reported as an
error by link validators and link checkers.
Window.requestFileSystem() - Web APIs
window.requestfilesystem(type, size, successcallback[,
errorcallback]); parameters type the type of storage to request.
...
errorcallback optional an optional parameter specifying a function which is called if an
error occurs while attempting to obtain the file system, or if the user denies permission to create or access the file system.
... the callback receives as input a single parameter: a file
error object describing the
error.
Worker() - Web APIs
exceptions a security
error is raised if the document is not allowed to start workers, e.g.
... a network
error is raised if the mime type of the worker script is incorrect.
... a syntax
error is raised if aurl cannot be parsed.
Worklet.addModule() - Web APIs
exceptions if addmodule() fails, it rejects the promise, delivering one of the following
errors to the rejection handler.
... abort
error the specified script is invalid or could not be loaded.
... syntax
error the specified moduleurl is invalid.
XDomainRequest - Web APIs
xdomainrequest.on
error a handler for when a request has
errored.
... example if(window.xdomainrequest){ var xdr = new xdomainrequest(); xdr.open("get", "http://example.com/api/method"); xdr.onprogress = function () { //progress }; xdr.ontimeout = function () { //timeout }; xdr.on
error = function () { //
error occurred }; xdr.onload = function() { //success(xdr.responsetext); } settimeout(function () { xdr.send(); }, 0); } note: the xdr.send() call is wrapped in a timeout (see window.settimeout() to prevent an issue with the interface where some requests are lost if multiple xdomainrequests are being sent at the same time.
...if these do not match, the request will
error "access is denied".
HTML in XMLHttpRequest - Web APIs
also, this limitation avoids problems with legacy code that assumes that responsexml is null for http
error pages (which often have a text/html response body).
...this throws an
error in the browsers that implement the feature and works on others.
... if (!window.xmlhttprequest) { window.settimeout(function() { callback(false); }, 0); return; } var done = false; var xhr = new window.xmlhttprequest(); xhr.onreadystatechange = function() { if (this.readystate == 4 && !done) { done = true; callback(!!(this.responsexml && this.responsexml.title && this.responsexml.title == "&&<")); } } xhr.onabort = xhr.on
error = function() { if (!done) { done = true; callback(false); } } try { xhr.open("get", "detect.html"); xhr.responsetype = "document"; xhr.send(); } catch (e) { window.settimeout(function() { if (!done) { done = true; callback(false); } }, 0); } } the argument callback is a function that will be called asynchronously with t...
XMLHttpRequest: abort event - Web APIs
bubbles no cancelable no interface progressevent event handler property onabort examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr
error" type="button" name="xhr" value="click to start xhr (
error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const...
... xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbutton
error = document.queryselector('.xhr.
error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('
error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get"...
..., url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbutton
error.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comment xmlhttprequest living standard ...
XMLHttpRequest: load event - Web APIs
bubbles no cancelable no interface progressevent event handler property onload examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr
error" type="button" name="xhr" value="click to start xhr (
error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbutton...
...success = document.queryselector('.xhr.success'); const xhrbutton
error = document.queryselector('.xhr.
error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('
error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); ...
... xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbutton
error.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comment xmlhttprequest living standard ...
XMLHttpRequest: loadstart event - Web APIs
bubbles no cancelable no interface progressevent event handler property onloadstart examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr
error" type="button" name="xhr" value="click to start xhr (
error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess ...
...= document.queryselector('.xhr.success'); const xhrbutton
error = document.queryselector('.xhr.
error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('
error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.se...
...nd(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbutton
error.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comment xmlhttprequest living standard ...
XMLHttpRequest: progress event - Web APIs
bubbles no cancelable no interface progressevent event handler property onprogress examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr
error" type="button" name="xhr" value="click to start xhr (
error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuc...
...cess = document.queryselector('.xhr.success'); const xhrbutton
error = document.queryselector('.xhr.
error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('
error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); x...
...hr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbutton
error.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comment xmlhttprequest living standard ...
XRWebGLLayer.framebuffer - Web APIs
calling functions such as framebuffertexture2d(), framebufferrenderbuffer(), deleteframebuffer(), or getframebufferattachmentparameter() on an opaque framebuffer results in the webgl
error invalid_operation (0x0502).
...attempting to clear, draw to, or read from the framebuffer results in a webgl invalid_framebuffer_operation
error (0x0506).
... calling checkframebufferstatus() on the webgl context from outside the animation frame callback causes the webgl framebuffer_unsupported
error (0x8cdd) to be reported.
Using the alert role - Accessibility
if the element was already in the original source code when the page loaded, the screen reader will announce the
error immediately after announcing the page title.
... <h2 role="alert">your form could not be submitted because of 3 validation
errors.</h2> example 2: dynamically adding an element with the alert role this snippet dynamically creates an element with an alert role and adds it to the document structure.
... note: in most cases this approach is not recommended, because it's not ideal to hide
error or alert text that is currently not applicable.
Using the aria-invalid attribute - Accessibility
values vocabulary: false (default) no
errors detected grammar a grammatical
error has been detected.
... spelling a spelling
error has been detected.
...lidity(aid, asearchterm, amsg){ var elem = document.getelementbyid(aid); var invalid = (elem.value.indexof(asearchterm) < 0); if (invalid) { elem.setattribute("aria-invalid", "true"); updatealert(amsg); } else { elem.setattribute("aria-invalid", "false"); updatealert(); } } the snippet below shows the alert functions, which add (or remove) the
error message: function updatealert(msg) { var oldalert = document.getelementbyid("alert"); if (oldalert) { document.body.removechild(oldalert); } if (msg) { var newalert = document.createelement("div"); newalert.setattribute("role", "alert"); newalert.setattribute("id", "alert"); var content = document.createtextnode(msg); newalert.appen...
Box-shadow generator - CSS: Cascading Style Sheets
node; this.topic = topic; this.checkbox = checkbox; checkbox.addeventlistener('change', function(e) { notify.call(this); }.bind(this)); buttons[topic] = this; } var getnode = function getnode(topic) { return buttons[topic].node; } var setvalue = function setvalue(topic, value) { try { buttons[topic].checkbox.checked = value; notify.call(buttons[topic]); } catch(
error) { console.log(
error, topic, value); } } var subscribe = function subscribe(topic, callback) { if (subscribers[topic] === undefined) subscribers[topic] = []; subscribers[topic].push(callback); } var unsubscribe = function unsubscribe(topic, callback) { subscribers[topic].indexof(callback); subscribers[topic].splice(index, 1); } var notify = function notify() { if (subs...
...'block' : 'none'; classes[topic].button.style.display = display; if (value === true) toggledisplay(topic); else toggledisplay('element'); } var updateproperty = function updateproperty(topic, property, data) { try { classes[topic].prop[property].textcontent = data + ';'; } catch(
error) { // console.log("
error undefined : ", topic, property, data); } } var toggleproperty = function toggleproperty(topic, property, value) { var display = (value === true) ?
... 'block' : 'none'; try { classes[topic].line[property].style.display = display; } catch(
error) { // console.log("
error undefined : ",classes, topic, property, value); } } var init = function init() { menu = getelembyid('menu'); var elem = document.queryselectorall('#output .output'); var size = elem.length; for (var i = 0; i < size; i++) outputclass(elem[i]); active = classes['element']; toggledisplay('element'); buttonmanager.subscribe("before", function(value) { togglebutton('before', value); }); buttonmanager.subscribe("after", function(value) { togglebutton('after', value); }); } return { init : init, updateproperty : updateproperty, toggleproperty : toggleproperty } })(); /** * init tool */ va...
Cross-browser audio basics - Developer guides
abort media data download has been aborted but not due to an
error.
...
error an
error is encountered while media data is being download.
... emptied the media buffer has been emptied, possibly due to an
error or because the load() method was invoked to reload it.
DOM onevent handlers - Developer guides
(the html specification names these: onblur, on
error, onfocus, onload, and onscroll.) event handler's parameters, this binding, and the return value when the event handler is specified as an html attribute, the specified code is wrapped into a function with the following parameters: event — for all event handlers except on
error.
... event, source, lineno, colno, and
error for the on
error event handler.
... note that the event parameter actually contains the
error message as a string.
Media events - Developer guides
error sent when an
error occurs.
... the element's
error attribute contains more information.
... see htmlmediaelement.
error for details.
<input type="datetime-local"> - HTML: Hypertext Markup Language
as a result, supporting browsers will display an
error if you try to submit a date that is outside the set bounds, or an empty date field.
...to june 30th 4.30pm):</label> <input id="party" type="datetime-local" name="partydate" min="2017-06-01t08:30" max="2017-06-30t16:30" required> <span class="validity"></span> </div> <div> <input type="submit" value="book party!"> </div> </form> if you try to submit the form with an incomplete date (or with a date outside the set bounds), the browser displays an
error.
...artydate" min="2017-06-01t08:30" max="2017-06-30t16:30" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}t[0-9]{2}:[0-9]{2}" required> <span class="validity"></span> </div> <div> <input type="submit" value="book party!"> </div> <input type="hidden" id="timezone" name="timezone" value="-08:00"> </form> if you try submitting it, you'll see that the browser now displays an
error message (and highlights the input as invalid) if your entry doesn't match the pattern nnnn-nn-nntnn:nn, where n is a number from 0 to 9.
<input type="month"> - HTML: Hypertext Markup Language
as a result, supporting browsers will display an
error if you try to submit a date that is outside the set bounds, or an empty date field.
... visit us (summer months only, please)?</label> <input id="month" type="month" name="month" min="2017-06" max="2017-09" required> <span class="validity"></span> </div> <div> <input type="submit" value="submit form"> </div> </form> if you try to submit the form without both the month and year specified (or with a date outside the set bounds), the browser displays an
error.
...(summer months only, yyyy-mm)</label> <input id="month" type="month" name="month" min="2017-06" max="2017-09" required pattern="[0-9]{4}-[0-9]{2}"> <span class="validity"></span> </div> <div> <input type="submit" value="submit form"> </div> </form> if you try submitting it, you'll see that the browser now displays an
error message (and highlights the input as invalid) if your entry doesn't match the pattern nnnn-nn, where n is a number from 0 to 9.
<input type="time"> - HTML: Hypertext Markup Language
as a result, supporting browsers will display an
error if you try to submit a time that is outside the set bounds, or an empty time field.
...e an appointment time (opening hours 12:00 to 18:00): </label> <input id="appt-time" type="time" name="appt-time" min="12:00" max="18:00" required> <span class="validity"></span> </div> <div> <input type="submit" value="submit form"> </div> </form> if you try to submit the form with an incomplete time (or with a time outside the set bounds), the browser displays an
error.
...n appointment time (opening hours 12:00 to 18:00): </label> <input id="appt-time" type="time" name="appt-time" min="12:00" max="18:00" required pattern="[0-9]{2}:[0-9]{2}"> <span class="validity"></span> </div> <div> <input type="submit" value="submit form"> </div> </form> if you try submitting it, you'll see that non-supporting browsers now display an
error message (and highlight the input as invalid) if your entry doesn't match the pattern nn:nn, where n is a number from 0 to 9.
<input type="url"> - HTML: Hypertext Markup Language
that's because the title may be displayed or spoken as part of a validation
error message.
...by doing that, the resulting full
error message might be something like "the entered text doesn't match the required pattern.
... the url should be in a myco domain." note: if you run into trouble while writing your validation regular expressions and they're not working properly, check your browser's console; there may be helpful
error messages there to aid you in solving the problem.
<script>: The Script element - HTML: Hypertext Markup Language
crossorigin normal script elements pass minimal information to the window.on
error for scripts which do not pass the standard cors checks.
... to allow
error logging for sites which use a separate domain for static media, use this attribute.
...if the script is blocked, an
error is sent to the element, if not a load event is sent.
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
use cases valid use cases for the <u> element include annotating spelling
errors, applying a proper name mark to denote proper names in chinese text, and other forms of annotation.
... examples indicating a spelling
error this example uses the <u> element and some css to display a paragraph which includes a misspelled
error, with the
error indicated in the red wavy underline style which is fairly commonly used for this purpose.
...this is a common styling for spelling
errors.
Global attributes - HTML: Hypertext Markup Language
the event handler attributes: onabort, onautocomplete, onautocomplete
error, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncontextmenu, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, on
error, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmou...
... spellcheck an enumerated attribute defines whether the element may be checked for spelling
errors.
... it may have the following values: true, which indicates that the element should be, if possible, checked for spelling
errors; false, which indicates that the element should not be checked for spelling
errors.
Reason: CORS request did not succeed - HTTP
the
error is not directly related to cors, but is a fundamental network
error of some kind.
... other possible causes include: trying to access an https resource that has an invalid certificate will cause this
error.
... trying to access an http resource from a page with an https origin will also cause this
error.
Reason: Did not find method in CORS header ‘Access-Control-Allow-Methods’ - HTTP
this header specifies a comma-delineated list of the http methods which may be used when using cors to access the url specified in the request; if the request is using any other method, this
error occurs.
... for example, if the response includes: access-control-allow-methods: get,head,post trying to use a put request will fail with this
error.
... note: if the server includes any unrecognized or undefined method names in its access-control-allow-methods header, a different
error occurs: reason: invalid token ‘xyz' in cors header ‘access-control-allow-methods’.
Cross-Origin Resource Sharing (CORS) - HTTP
cors failures result in
errors, but for security reasons, specifics about the
error are not available to javascript.
... all the code knows is that an
error occurred.
...if a redirect occurs after a preflighted request, some browsers currently will report an
error message such as the following.
HTTP conditional requests - HTTP
the more flexible one makes use of if-unmodified-since and if-match and the server returns an
error if the precondition fails; the client then restarts the download from the beginning: even if this method works, it adds an extra response/request exchange when the document has been changed.
...if the etag doesn't match the original file, or if the file has been modified since it has been obtained, the change is simply rejected with a 412 precondition failed
error.
... it is then up to the client to deal with the
error: either by notifying the user to start again (this time on the newest version), or by showing the user a diff of both versions, helping them decide which changes they wish to keep.
Redirections in HTTP - HTTP
most of the time this is a server problem, and if the server cannot detect it, it will send back a 500 internal server
error.
... if you encounter such an
error soon after modifying a server configuration, this is likely a redirection loop.
...in this case, browsers will detect it and display an
error message.
404 Not Found - HTTP
the http 404 not found client
error response code indicates that the server can't find the requested resource.
... status 404 not found custom
error pages many web sites customize the look of a 404 page to be more helpful to the user and provide guidance on what to do next.
...
errordocument 404 /notfound.html for an example of a custom 404 page, see mdn's 404 page.
412 Precondition Failed - HTTP
the hypertext transfer protocol (http) 412 precondition failed client
error response code indicates that access to the target resource has been denied.
...in that case, the request, usually an upload or a modification of a resource, cannot be made and this
error response is sent back.
... if-match: "33a64df551425fcc55e4d42a148795d9f25f89d4" if the hashes don't match, it means that the document has been edited in-between and a 412 precondition failed
error is thrown.
Indexed collections - JavaScript
// // this is equivalent to: let arr = [] arr.length = 42 calling array(n) results in a range
error, if n is a non-whole number whose fractional portion is non-zero.
... let arr = array(9.3) // range
error: invalid array length if your code needs to create arrays with single elements of an arbitrary data type, it is safer to use array literals.
... function printarguments() { arguments.foreach(function(item) { // type
error: arguments.foreach is not a function console.log(item); }); } but you can call them indirectly using function.prototype.call().
Method definitions - JavaScript
this means that legacy generator functions won't work either, and will throw a syntax
error.
...they will throw a type
error if you try to instantiate them.
... const obja = { method() {} } new obja.method // type
error: obj.method is not a constructor const objb = { * g() {} } new objb.g // type
error: obj.g is not a constructor (changed in es2016) examples simple test case const obj = { a: 'foo', b() { return this.a } }; console.log(obj.b()) // "foo" computed property names the shorthand syntax also supports computed property names.
Array.prototype.find() - JavaScript
if (this == null) { throw type
error('"this" is null or not defined'); } var o = object(this); // 2.
...if iscallable(predicate) is false, throw a type
error exception.
... if (typeof predicate !== 'function') { throw type
error('predicate must be a function'); } // 4.
Array.prototype.findIndex() - JavaScript
if (this == null) { throw new type
error('"this" is null or not defined'); } var o = object(this); // 2.
...if iscallable(predicate) is false, throw a type
error exception.
... if (typeof predicate !== 'function') { throw new type
error('predicate must be a function'); } // 4.
Array.prototype.indexOf() - JavaScript
this algorithm matches the one specified in ecma-262, 5th edition, assuming type
error and math.abs() have their original values.
...if (!array.prototype.indexof) array.prototype.indexof = (function(object, max, min) { "use strict" return function indexof(member, fromindex) { if (this === null || this === undefined) throw type
error("array.prototype.indexof called on null or undefined") var that = object(this), len = that.length >>> 0, i = min(fromindex | 0, len) if (i < 0) i = max(0, len + i) else if (i >= len) return -1 if (member === void 0) { // undefined for (; i !== len; ++i) if (that[i] === void 0 && i in that) return i } else if (member !== member) { // nan retur...
... if (this == null) { throw new type
error('"this" is null or not defined'); } var o = object(this); // 2.
ArrayBuffer() constructor - JavaScript
exceptions a range
error is thrown if the length is larger than number.max_safe_integer (>= 2 ** 53) or negative.
...calling an arraybuffer constructor as a function without new, will throw a type
error from now on.
... var dv = arraybuffer(10); // type
error: calling a builtin arraybuffer constructor // without new is forbidden var dv = new arraybuffer(10); examples creating an arraybuffer in this example, we create a 8-byte buffer with a int32array view referring to the buffer: var buffer = new arraybuffer(8); var view = new int32array(buffer); specifications specification ecmascript (ecma-262)the definition of 'arraybuffer' in that specification.
Function.prototype.bind() - JavaScript
th `new (funca.bind(thisarg, args))` if (!function.prototype.bind) (function(){ var slice = array.prototype.slice; function.prototype.bind = function() { var thatfunc = this, thatarg = arguments[0]; var args = slice.call(arguments, 1); if (typeof thatfunc !== 'function') { // closest thing possible to the ecmascript 5 // internal iscallable function throw new type
error('function.prototype.bind - ' + 'what is trying to be bound is not callable'); } return function(){ var funcargs = args.concat(slice.call(arguments)) return thatfunc.apply(thatarg, funcargs); }; }; })(); you can partially work around this by inserting the following code at the beginning of your scripts, allowing use of much of the functionality of bind() in ...
... // yes, it does work with `new (funca.bind(thisarg, args))` if (!function.prototype.bind) (function(){ var arrayprototypeslice = array.prototype.slice; function.prototype.bind = function(otherthis) { if (typeof this !== 'function') { // closest thing possible to the ecmascript 5 // internal iscallable function throw new type
error('function.prototype.bind - what is trying to be bound is not callable'); } var baseargs= arrayprototypeslice.call(arguments, 1), baseargslength = baseargs.length, ftobind = this, fnop = function() {}, fbound = function() { baseargs.length = baseargslength; // reset to default base arguments baseargs.push.apply(baseargs, arguments); ...
... the partial implementation creates functions that do not have immutable "poison pill" caller and arguments properties that throw a type
error upon get, set, or deletion.
Number.prototype.toExponential() - JavaScript
exceptions range
error if fractiondigits is too small or too large.
... values between 0 and 20, inclusive, will not cause a range
error.
... type
error if this method is invoked on an object that is not a number.
Number.prototype.toFixed() - JavaScript
exceptions range
error if digits is too small or too large.
... values between 0 and 100, inclusive, will not cause a range
error.
... type
error if this method is invoked on an object that is not a number.
Object.assign() - JavaScript
in case of an
error, for example if a property is non-writable, a type
error is raised, and the target object is changed if any properties are added before the
error is raised.
...l doesn't support symbol properties, since es5 doesn't have symbols anyway: if (typeof object.assign !== 'function') { // must be writable: true, enumerable: false, configurable: true object.defineproperty(object, "assign", { value: function assign(target, varargs) { // .length of function is 2 'use strict'; if (target === null || target === undefined) { throw new type
error('cannot convert undefined or null to object'); } var to = object(target); for (var index = 1; index < arguments.length; index++) { var nextsource = arguments[index]; if (nextsource !== null && nextsource !== undefined) { for (var nextkey in nextsource) { // avoid bugs when hasownproperty is shadowed if (object.prototype.hasown...
...console.log(obj); // { "0": "a", "1": "b", "2": "c" } exceptions will interrupt the ongoing copying task const target = object.defineproperty({}, 'foo', { value: 1, writable: false }); // target.foo is a read-only property object.assign(target, { bar: 2 }, { foo2: 3, foo: 3, foo3: 3 }, { baz: 4 }); // type
error: "foo" is read-only // the exception is thrown when assigning target.foo console.log(target.bar); // 2, the first source was copied successfully.
Object.keys() - JavaScript
g'), dontenums = [ 'tostring', 'tolocalestring', 'valueof', 'hasownproperty', 'isprototypeof', 'propertyisenumerable', 'constructor' ], dontenumslength = dontenums.length; return function(obj) { if (typeof obj !== 'function' && (typeof obj !== 'object' || obj === null)) { throw new type
error('object.keys called on non-object'); } var result = [], prop, i; for (prop in obj) { if (hasownproperty.call(obj, prop)) { result.push(prop); } } if (hasdontenumbug) { for (i = 0; i < dontenumslength; i++) { if (hasownproperty.call(obj, dontenums[i])) { result.push(dontenums[i]); } } }...
... non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a type
error.
... // in es5 object.keys('foo'); // type
error: "foo" is not an object // in es2015+ object.keys('foo'); // ["0", "1", "2"] specifications specification ecmascript (ecma-262)the definition of 'object.keys' in that specification.
Promise() constructor - JavaScript
the executor might also include a try{} catch() block that invokes rejectionfunc upon
error.
...the second (reject) is called when the task fails, and returns the reason for failure, which is typically an
error object.
...(somevalue) // fulfilled // or // reject("failure reason") // rejected }); making functions return a promise to provide a function with promise functionality, have it return a promise: function myasyncfunction(url) { return new promise((resolve, reject) => { const xhr = new xmlhttprequest() xhr.open("get", url) xhr.onload = () => resolve(xhr.responsetext) xhr.on
error = () => reject(xhr.statustext) xhr.send() }); } specifications specification ecmascript (ecma-262)the definition of 'promise constructor' in that specification.
Promise.all() - JavaScript
it rejects immediately upon any of the input promises rejecting or non-promises throwing an
error, and will reject with this first rejection message /
error.
...((resolve, reject) => { settimeout(() => resolve('one'), 1000); }); var p2 = new promise((resolve, reject) => { settimeout(() => resolve('two'), 2000); }); var p3 = new promise((resolve, reject) => { settimeout(() => resolve('three'), 3000); }); var p4 = new promise((resolve, reject) => { settimeout(() => resolve('four'), 4000); }); var p5 = new promise((resolve, reject) => { reject(new
error('reject')); }); // using .catch: promise.all([p1, p2, p3, p4, p5]) .then(values => { console.log(values); }) .catch(
error => { console.
error(
error.message) }); //from console: //"reject" it is possible to change this behaviour by handling possible rejections: var p1 = new promise((resolve, reject) => { settimeout(() => resolve('p1_delayed_resolution'), 1000); }); var p2 = new promis...
...e((resolve, reject) => { reject(new
error('p2_immediate_rejection')); }); promise.all([ p1.catch(
error => { return
error }), p2.catch(
error => { return
error }), ]).then(values => { console.log(values[0]) // "p1_delayed_resolution" console.
error(values[1]) // "
error: p2_immediate_rejection" }) specifications specification ecmascript (ecma-262)the definition of 'promise.all' in that specification.
handler.construct() - JavaScript
interceptions this trap can intercept these operations: new proxy(...args) reflect.construct() invariants if the following invariants are violated, the proxy will throw a type
error: the result must be an object.
... const p = new proxy(function() {}, { construct: function(target, argumentslist, newtarget) { return 1; } }); new p(); // type
error is thrown the following code improperly initializes the proxy.
... const p = new proxy({}, { construct: function(target, argumentslist, newtarget) { return {}; } }); new p(); // type
error is thrown, "p" is not a constructor specifications specification ecmascript (ecma-262)the definition of '[[construct]]' in that specification.
handler.set() - JavaScript
if the set() method returns false, and the assignment happened in strict-mode code, a type
error will be thrown.
... interceptions this trap can intercept these operations: property assignment: proxy[foo] = bar and proxy.foo = bar inherited property assignment: object.create(proxy)[foo] = bar reflect.set() invariants if the following invariants are violated, the proxy will throw a type
error: cannot change the value of a property to be different from the value of the corresponding target object property if the corresponding target object property is a non-writable, non-configurable data property.
... in strict mode, a false return value from the set() handler will throw a type
error exception.
Reflect.defineProperty() - JavaScript
exceptions a type
error, if target is not an object.
... one key difference: object.defineproperty returns the object or throws a type
error if the property has not been successfully defined.
... examples using reflect.defineproperty() let obj = {} reflect.defineproperty(obj, 'x', {value: 7}) // true obj.x // 7 checking if property definition has been successful with object.defineproperty, which returns an object if successful, or throws a type
error otherwise, you would use a try...catch block to catch any
error that occurred while defining a property.
Reflect.getOwnPropertyDescriptor() - JavaScript
exceptions a type
error, if target is not an object.
...value: "hello", writable: true, enumerable: true, configurable: true} reflect.getownpropertydescriptor({x: 'hello'}, 'y') // undefined reflect.getownpropertydescriptor([], 'length') // {value: 0, writable: true, enumerable: false, configurable: false} difference to object.getownpropertydescriptor() if the target argument to this method is not an object (a primitive), then it will cause a type
error.
... reflect.getownpropertydescriptor('foo', 0) // type
error: "foo" is not non-null object object.getownpropertydescriptor('foo', 0) // { value: "f", writable: false, enumerable: true, configurable: false } specifications specification ecmascript (ecma-262)the definition of 'reflect.getownpropertydescriptor' in that specification.
Reflect.isExtensible() - JavaScript
exceptions a type
error, if target is not an object.
...let frozen = object.freeze({}) reflect.isextensible(frozen) // === false difference to object.isextensible() if the target argument to this method is not an object (a primitive), then it will cause a type
error.
... reflect.isextensible(1) // type
error: 1 is not an object object.isextensible(1) // false specifications specification ecmascript (ecma-262)the definition of 'reflect.isextensible' in that specification.
Reflect.preventExtensions() - JavaScript
exceptions a type
error, if target is not an object.
...reflect.preventextensions(empty) reflect.isextensible(empty) // === false difference from object.preventextensions() if the target argument to this method is not an object (a primitive), then it will cause a type
error.
... reflect.preventextensions(1) // type
error: 1 is not an object object.preventextensions(1) // 1 specifications specification ecmascript (ecma-262)the definition of 'reflect.preventextensions' in that specification.
String.prototype.replaceAll() - JavaScript
syntax const newstr = str.replaceall(regexp|substr, newsubstr|function) when using a `regexp` you must have to set the global ("g") flag; otherwise, it will throw a type
error: "replaceall must be called with a global regexp".
...a regexp without the global ("g") flag will throw a type
error: "replaceall must be called with a global regexp".
...this won't work: 'aabbcc'.replaceall(/b/, '.'); type
error: replaceall must be called with a global regexp this will work: 'aabbcc'.replaceall(/b/g, '.'); "aa..cc" specifications specification ecmascript (ecma-262)the definition of 'string.prototype.replaceall' in that specification.
Symbol.match - JavaScript
for example, the methods string.prototype.startswith(), string.prototype.endswith() and string.prototype.includes(), check if their first argument is a regular expression and will throw a type
error if they are.
... property attributes of symbol.match writable no enumerable no configurable no examples disabling the isregexp check the following code will throw a type
error: '/bar/'.startswith(/bar/); // throws type
error, as /bar/ is a regular expression // and symbol.match is not modified.
...the methods startswith and endswith won't throw a type
error as a consequence.
Symbol - JavaScript
it creates a new symbol each time: symbol('foo') === symbol('foo') // false the following syntax with the new operator will throw a type
error: let sym = new symbol() // type
error this prevents authors from creating an explicit symbol wrapper object instead of a new symbol value and might be surprising as creating explicit wrapper objects around primitive data types is generally possible (for example, new boolean, new string and new number).
... when trying to convert a symbol to a number, a type
error will be thrown (e.g.
... symbol("foo") + "bar" throws a type
error (can't convert symbol to string).
TypedArray - JavaScript
calling it or using it in a new expression will throw a type
error, except when used during object creation in js engines that support subclassing.
...calling a typedarray constructor as a function without new will throw a type
error.
... var dv = int8array([1, 2, 3]); // type
error: calling a builtin int8array constructor // without new is forbidden var dv = new int8array([1, 2, 3]); property access you can reference elements in the array using standard array index syntax (that is, using bracket notation).
WebAssembly.instantiateStreaming() - JavaScript
there must be one matching property for each declared import of the compiled module or else a webassembly.link
error is thrown.
... exceptions if either of the parameters are not of the correct type or structure, a type
error is thrown.
... if the operation fails, the promise rejects with a webassembly.compile
error, webassembly.link
error, or webassembly.runtime
error, depending on the cause of the failure.
undefined - JavaScript
typeof operator and undefined alternatively, typeof can be used: var x; if (typeof x === 'undefined') { // these statements execute } one reason to use typeof is that it does not throw an
error if the variable has not been declared.
... // x has not been declared before if (typeof x === 'undefined') { // evaluates to true without
errors // these statements execute } if (x === undefined) { // throws a reference
error } however, there is another alternative.
... var x; if (x === void 0) { // these statements execute } // y has not been declared before if (y === void 0) { // throws uncaught reference
error: y is not defined } specifications specification ecmascript (ecma-262)the definition of 'undefined' in that specification.
Nullish coalescing operator (??) - JavaScript
a syntax
error will be thrown in such cases.
..."foo"; // raises a syntax
error true || undefined ??
... "foo"; // raises a syntax
error however, providing parenthesis to explicitly indicate precedence is correct: (null || undefined) ??
class expression - JavaScript
class expressions allow you to redefine (re-declare) classes without throwing a syntax
error.
... 'use strict'; let foo = class {}; // constructor property is optional foo = class {}; // re-declaration is allowed typeof foo; // returns "function" typeof class {}; // returns "function" foo instanceof object; // true foo instanceof function; // true class foo {} // throws syntax
error (class declarations do not allow re-declaration) examples a simple class expression this is just a simple anonymous class expression which you can refer to using the variable foo.
... const foo = class namedfoo { constructor() {} whoisthere() { return namedfoo.name; } } const bar = new foo(); bar.whoisthere(); // "namedfoo" namedfoo.name; // reference
error: namedfoo is not defined foo.name; // "namedfoo" specifications specification ecmascript (ecma-262)the definition of 'class definitions' in that specification.
this - JavaScript
calling super() creates a this binding within the constructor and essentially has the effect of evaluating the following line of code, where base is the inherited class: this = new base(); warning: referring to this before calling super() will throw an
error.
... class base {} class good extends base {} class alsogood extends base { constructor() { return {a: 5}; } } class bad extends base { constructor() {} } new good(); new alsogood(); new bad(); // reference
error examples this in function contexts // an object can be passed as the first argument to call or apply and this will be bound to it.
...calling methods with an undefined this will throw an
error.
break - JavaScript
outer_block: { inner_block: { console.log('1'); break outer_block; // breaks out of both inner_block and outer_block console.log(':-('); // skipped } console.log('2'); // skipped } break in labeled blocks that throw the following code also uses break statements with labeled blocks, but generates a syntax
error because its break statement is within block_1 but references block_2.
... block_1: { console.log('1'); break block_2; // syntax
error: label not found } block_2: { console.log('2'); } break within functions syntax
errors are also generated in the following code examples which use break statements within functions that are nested within a loop, or labeled block that the break statements are intended to break out of.
... function testbreak(x) { var i = 0; while (i < 6) { if (i == 3) { (function() { break; })(); } i += 1; } return i * x; } testbreak(1); // syntax
error: illegal break statement block_1: { console.log('1'); ( function() { break block_1; // syntax
error: undefined label 'block_1' })(); } specifications specification ecmascript (ecma-262)the definition of 'break statement' in that specification.
throw - JavaScript
each of the following throws an exception: throw '
error2'; // generates an exception with a string value throw 42; // generates an exception with the value 42 throw true; // generates an exception with the value true throw new
error('required'); // generates an
error object with the message of required also note that the throw statement is affected by automatic semicolon insertion (asi) as no line terminator between the throw keyword and ...
...eb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']; if (months[mo] !== undefined) { return months[mo]; } else { throw new userexception('invalidmonthno'); } } try { // statements to try var mymonth = 15; // 15 is out of bound to raise the exception var monthname = getmonthname(mymonth); } catch (e) { monthname = 'unknown'; console.
error(e.message, e.name); // pass exception object to err handler } another example of throwing an object the following example tests an input string for a u.s.
... */ const zipcode_invalid = -1; const zipcode_unknown_
error = -2; function verifyzipcode(z) { try { z = new zipcode(z); } catch (e) { if (e instanceof zipcodeformatexception) { return zipcode_invalid; } else { return zipcode_unknown_
error; } } return z; } a = verifyzipcode(95060); // returns 95060 b = verifyzipcode(9560); // returns -1 c = verifyzipcode('a'); // returns -1 ...
Trailing commas - JavaScript
f(p); f(p,); math.max(10, 20); math.max(10, 20,); illegal trailing commas function parameter definitions or function invocations only containing a comma will throw a syntax
error.
... furthermore, when using a rest parameters, trailing commas are not allowed: function f(,) {} // syntax
error: missing formal parameter (,) => {}; // syntax
error: expected expression, got ',' f(,) // syntax
error: expected expression, got ',' function f(...p,) {} // syntax
error: parameter after rest parameter (...p,) => {} // syntax
error: expected closing parenthesis, got ',' trailing commas in destructuring a trailing comma is also allowed on the left-hand side when using destructuring assignment: // array destructuring with trailing comma [a, b,] = [1, 2]; // object destructuring with trailing comma var o = { p: 42, q: true, }; var {p, q,} = o; again, when using a rest element, a syntax
error will be thrown: var [a, ...b,] = [1, 2, 3]; // syntax
error: rest ...
... both lines will throw a syntax
error: json.parse('[1, 2, 3, 4, ]'); json.parse('{"foo" : 1, }'); // syntax
error json.parse: unexpected character // at line 1 column 14 of the json data omit the trailing commas to parse the json correctly: json.parse('[1, 2, 3, 4 ]'); json.parse('{"foo" : 1 }'); specifications specification ecmascript (ecma-262) ...
The "codecs" parameter in common media types - Web media technologies
hvxc (harmonic vector excitation coding) main, scalable, speech, ld 10 – 11 reserved 12 ttsi (text to speech interface) main, scalable, speech, synthetic, ld 13 main synthetic main, synthetic 14 wavetable synthesis 15 general midi 16 algorithmic synthesis and audio effects 17 er aac lc (
error resilient aac low-complexity) hq, mobile internetworking 18 reserved 19 er aac ltp (
error resilient aac long term prediction) hq 20 er aac scalable (
error resilient aac scalable) mobile internetworking 21 er twinvq (
error resilient twinvq) mobile internetworking 22 er bsac (
error reslient bit-sliced arithmetic coding) ...
...mobile internetworking 23 er aac ld (
error resilient aac low-delay; used for two-way communication) ld, mobile internetworking 24 er celp (
error resilient code-excited linear prediction) hq, ld 25 er hvxc (
error resilient harmonic vector excitation coding) ld 26 er hiln (
error resilient harmonic and individual line plus noise) 27 er parametric (
error resilient parametric) 28 ssc (sinusoidal coding) 29 ps (parametric stereo) he-aac v2 30 mpeg surround 31 escape 32 mpeg-1 layer-1 33 mpeg-1 layer-2 (mp2) 34 mpeg-1 layer-3 (mp3) 35 dst (direct stream transfer) 36 als (audio lossless) ...
... 37 sls (scalable lossless) 38 sls non-core (scalable lossless non-core) 39 er aac eld (
error resilient aac enhanced low delay) 40 smr simple (symbolic music representation simple) 41 smr main (symbolic music representation main) 42 reserved 43 saoc (spatial audio object coding)[1] 44 ld mpeg surround (low delay mpeg surround)[1] 45 and up reserved [1] saoc and ld mpeg surround are defined in iso/iec 14496-3:2009/amd.2:2010(e).
SVG In HTML Introduction - SVG: Scalable Vector Graphics
source here is the source to the example: <html> <head> <title>xtech svg demo</title> <style> stop.begin { stop-color:yellow; } stop.end { stop-color:green; } body.invalid stop.end { stop-color:red; } #err { display:none; } body.invalid #err { display:inline; } </style> <script> function signal
error() { document.getelementbyid('body').setattribute("class", "invalid"); } </script> </head> <body id="body" style="position:absolute; z-index:0; border:1px solid black; left:5%; top:5%; width:90%; height:90%;"> <form> <fieldset> <legend>html form</legend> <p><label>enter something:</label> <input type="text"> <span id="err">incorrect value!</span></p> <p><input type="b...
...utton" value="activate!" onclick="signal
error();"></p> </fieldset> </form> <svg viewbox="0 0 100 100" preserveaspectratio="xmidymid slice" style="width:100%; height:100%; position:absolute; top:0; left:0; z-index:-1;"> <lineargradient id="gradient"> <stop class="begin" offset="0%"/> <stop class="end" offset="100%"/> </lineargradient> <rect x="0" y="0" width="100" height="100" style="fill:url(#gradient)" /> <circle cx="50" cy="50" r="30" style="fill:url(#gradient)" /> </svg> </body> </html> discussion the page is mainly regular html, css and javascript.
...(another style rule makes an
error message appear.) this approach has the following points in its favor: we have taken a regular html form that could have been part of an existing web site, and added an attractive, interactive background the approach is backwards compatible to browsers that do not support svg; simply, no background appears in them it's very simple and performs very well the picture dynamically sizes itself ...
Introduction to using XPath in JavaScript - XPath
ath interface will not automatically convert the numerical result if the stringvalue property is requested, so the following code will not work: var paragraphcount = document.evaluate('count(//p)', document, null, xpathresult.any_type, null ); alert( 'this document contains ' + paragraphcount.stringvalue + ' paragraph elements' ); instead, it will return an exception with the code ns_dom_type_
error.
... note however, that if the document is mutated (the document tree is modified) between iterations that will invalidate the iteration and the invaliditeratorstate property of xpathresult is set to true, and a ns_
error_dom_invalid_state_err exception is thrown.
... iterator example var iterator = document.evaluate('//phonenumber', documentnode, null, xpathresult.unordered_node_iterator_type, null ); try { var thisnode = iterator.iteratenext(); while (thisnode) { alert( thisnode.textcontent ); thisnode = iterator.iteratenext(); } } catch (e) { alert( '
error: document tree modified during iteration ' + e ); } snapshots when the specified result type in the resulttype parameter is either: unordered_node_snapshot_type ordered_node_snapshot_type the xpathresult object returned is a static node-set of matched nodes, which allows us to access each node through the snapshotitem(itemnumber) method of the xpathresult object, where itemnumber is the index of the node to be retrieved.
SDK API Lifecycle - Archive of obsolete content
attempts to use a deprecated module at runtime will log an
error to the
error console.
... the amo validator will throw
errors when deprecated modules are used, and these add-ons will therefore fail amo review.
page-mod - Archive of obsolete content
error this event is emitted when an uncaught runtime
error occurs in one of the page-mod's content scripts.
... arguments
error : listeners are passed a single argument, the
error object.
page-worker - Archive of obsolete content
the message can be any json-serializable value
error this event is emitted when an uncaught runtime
error occurs in one of the page worker's content scripts.
... arguments
error : listeners are passed a single argument, the
error object.
panel - Archive of obsolete content
error this event is emitted when an uncaught runtime
error occurs in one of the panel's content scripts.
... arguments
error : listeners are passed a single argument, the
error object.
tabs - Archive of obsolete content
on
error function a function called when the content worker receives an
error from content scripts.
... listeners are passed a single argument,
error, which is the
error posted from the content script and an object of type
error.
Logging - Archive of obsolete content
because dom objects aren't available to the main add-on code, the sdk provides its own global console object with most of the same methods as the dom console, including methods to log
error, warning, or informational messages.
... but note that by default, calls to console.log() will not result in any output in the
error console for any installed add-ons: this includes add-ons installed using the add-on builder or using tools like the extension auto-installer.
Canvas code snippets - Archive of obsolete content
if you try running the code as a plain webpage, you will get a 'security
error" code: "1000'
error.
... var canvas = document.createelement('canvas'); var ctxt = canvas.getcontext('2d'); function loadimagefile(url, callback) { var image = new image(); image.src = url; return new promise((accept, reject) => { image.onload = accept; image.on
error = reject; }).then(accept => { canvas.width = this.width; canvas.height = this.height; ctxt.clearrect(0, 0, this.width, this.height); ctxt.drawimage(this, 0, 0); accept(canvas.todataurl()); }); } usage: loadimagefile('myimage.jpg').then(string64 => { alert(string64); }); if you want to get instead the base64 content of a local file using the file <input> element, you m...
Downloading Files - Archive of obsolete content
xt, passwordrealm, savepassword, pwd) { pwd.value = hardcodedpassword; return true; }, promptusernameandpassword: function(dialogtitle, text, passwordrealm, savepassword, user, pwd) { user.value = hardcodedusername; pwd.value = hardcodedpassword; return true; } }; persist.saveuri(urltosave, null, null, null, "", nsfileinstance, privacy); the above is going to give you
errors about missing nsidownloadprogresslistener methods, so you should implement that as well.
...// returns empty if the file is not found (with an 404
error for instance).
File I/O - Archive of obsolete content
so therefore for the first parameter, file, you can pass an nsifile object or a string (such as a jar path) see: netutil.asyncfetch: components.utils.import("resource://gre/modules/netutil.jsm"); netutil.asyncfetch(file, function(inputstream, status) { if (!components.issuccesscode(status)) { // handle
error!
...netutil.asynccopy(istream, ostream, function(status) { if (!components.issuccesscode(status)) { // handle
error!
Rosetta - Archive of obsolete content
"" : odicts[smimetype](oscript.text); obaton.parentnode.insertbefore(ocompiled, obaton); } function req
error (o
error) { throw new uri
error("the script " + o
error.target.src + " is not accessible."); } function reqsuccess () { createscript(this.refscript, this); } function getsource (oscript) { var oreq = new xmlhttprequest(); oreq.onload = reqsuccess; oreq.on
error = req
error; oreq.refscript = oscript; oreq.open("get", oscript.src, true); oreq.send(null); } ...
...tsbytagname("script"), nidx = 0; nidx < ascripts.length; parsescript(ascripts[nidx++]) ); } var odicts = {}, rignoremimes = /^\s*(?:text\/javascript|text\/ecmascript)\s*$/; this.translatescript = parsescript; this.translateall = parsedocument; this.appendcompiler = function (vmimetypes, fcompiler) { if (arguments.length < 2) { throw new type
error("rosetta.appendcompiler() \u2013 not enough arguments"); } if (typeof fcompiler !== "function") { throw new type
error("rosetta.appendcompiler() \u2013 second argument must be a function"); } if (!array.isarray(vmimetypes)) { odicts[(vmimetypes).tostring()] = fcompiler; return true; } for (var nidx = 0; nidx < vmimetypes.length; nidx++) { odicts[(...
StringView - Archive of obsolete content
however, this is slow and
error-prone, due to the need for multiple conversions (especially if the binary data is not actually byte-format data, but, for example, 32-bit integers or floats).
...infinity : nchrlength; if (nchrlength + 1 > atarget.length) { throw new range
error("stringview.prototype.makeindex - the offset can\'t be major than the length of the array - 1."); } switch (this.encoding) { case "utf-8": var npart; for (nchrend = 0; nidxend < nrawlength && nchrend < nstopatchr; nchrend++) { npart = atarget[nidxend]; nidxend += npart > 251 && npart < 254 && nidxend + 5 < nrawlength ?
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
otherwise the first module's xpt file will be overwritten by the second and you'll get ns_
error_xpc_bad_iid
errors when you try to access its idl interfaces from your code.
...the component implementation will include the methods for retrieving the path or file for the extension's home directory: mylocation.prototype = { queryinterface: function(iid) { if (iid.equals(nsisupports)) return this; if (iid.equals(myilocation)) return this; components.returncode = components.results.ns_
error_no_interface; return null; }, get locationfile() { return __location__.parent.parent; } } this assumes that the component resides in a subdirectory of the extension directory (by convention, this directory is called components/).
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
- #include "nsastring.h"- #include "nsstring.h"- #include "nsreadableutils.h"- #include "nsescape.h" + #include "nsstringapi.h" on windows, if you see the following
error, you are including a header you shouldn't be: nsstringfwd.h(60) : fatal
error c1001: internal compiler
error to debug this
error, make in the failing directory, adding the /showincludes directive to figure out what is being included incorrectly: make -c directory/that/failed os_cppflags=-showincludes the frozen string api is similar but not identical to the nonfrozen string api.
...for
errors about undeclared do_createinstance: #include "nscomponentmanagerutils.h" for
errors about undeclared do_getservice: #include "nsservicemanagerutils.h" for
errors about undeclared ns_getspecialdirectory: #include "nsdirectoryserviceutils.h" utility classes some utility classes could previously be created with ns_new* utility functions.
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
init: function() { this.stack = new array(); }, push: function(val) { this.stack.push(number(val)); }, _letfunc: function(func) { a = this.pop(); b = this.pop(); this.push(func(a, b)); }, plus: function() { return this._letfunc(this._plus); }, _plus: function(a, b) { return a + b; }, pop: function() { return this.stack.pop(); } } check for
errors now you’re ready for your first test.
...relative paths will throw
errors.
Install.js - Archive of obsolete content
xtskinnames[skin] + '/' + this.extshortname + '/'; install.registerchrome(install.skin | installtype, jarpath, regpath); } // perform install var err = install.performinstall(); if (err == install.success || err == install.reboot_needed) { if (!this.silentinstall && this.extpostinstallmessage) { install.alert(this.extpostinstallmessage); } } else { this.handle
error(err); return; } }, parsearguments: function() { // can't use string handling in install, so use if statement instead var args = install.arguments; if (args == 'p=0') { this.profileinstall = false; this.silentinstall = true; } else if (args == 'p=1') { this.profileinstall = true; this.silentinstall = true; } }, handle
error: function(err) { if (!this.sil...
...entinstall) { install.alert('
error: could not install ' + this.extfullname + ' ' + this.extversion + ' (
error code: ' + err + ')'); } install.cancelinstall(err); } }; xpiinstaller.install(); ...
Monitoring WiFi access points - Archive of obsolete content
netscape.security.privilegemanager.enableprivilege('universalxpconnect'); var d = document.getelementbyid("d"); d.innerhtml = ""; for (var i=0; i<accesspoints.length; i++) { var a = accesspoints[i]; d.innerhtml += "<p>" + a.mac + " " + a.ssid + " " + a.signal + "</p>"; } var c = document.getelementbyid("c"); c.innerhtml = "<p>" + count++ + "</p>"; }, on
error: function (value) { alert("
error: " +value); }, queryinterface: function(iid) { netscape.security.privilegemanager.enableprivilege('universalxpconnect'); if (iid.equals(components.interfaces.nsiwifilistener) || iid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_
error_no_interface; }, } netscape.se...
...the on
error() method simply opens an alert that displays the
error code received.
No Proxy For configuration - Archive of obsolete content
proxy connections that fail return an
error "the proxy server you have configured cannot be found", so configure your browser to use a non-existent http proxy (hostname: "imaginary", port "80").
...all proxied urls will return
errors, all non-proxied connections will be attempted normally (direct connection).
Locked config settings - Archive of obsolete content
if you suspect syntax
errors in your config file, you can display the exact
error message by enclosing your code in a try-catch block: try { ...
... } catch(e) { display
error("test", e); } clear text configuration if you don't care about encoding the mozilla.cfg file, append this config to all.js instead : pref("general.config.obscure_value", 0); pref("general.config.filename", "mozilla.cfg"); ...
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
make sure the mimetypes of your html embed tags match the mimetype specified in your nprt.rc file and the top of your npp_gate.cpp file version issues if vc++ compiler throws you
error c2664 on 'drawtext' function call, you may replace it by 'drawtexta'.
... in fact, all win32 api functions dealing with character strings can be added an 'a' to the end to avoid unicode cast
errors.
Using Dehydra - Archive of obsolete content
class __attribute__((user("final"))) myclass { }; // this subclass should be an
error class subclass : public myclass { }; save the following analysis script final.js: /** * helper function: returns true if a class is marked with the "final" attribute.
... */ function isfinal(c) { if (!c.attributes) return false; for each (let a in c.attributes) if (a.name == 'user' && a.value == 'final') return true; return false; } function process_type(t) { if (t.bases) for each (let base in t.bases) if (isfinal(base.type))
error("class " + t.name + " extends final class " + base.type.name, t.loc); } compile using the following command: $ g++ -fplugin=~/dehydra/gcc_dehydra.so -fplugin-arg=~/final.js -o/dev/null -c final.cc it should print the following results and return with an
error code: final.cc:8:
error: class subclass extends final class myclass see documentation for: process_type,
error, .bases property, .attributes property ...
Creating a Help Content Pack - Archive of obsolete content
understanding the syntax is important because small syntax
errors can mean that a whole file won't be loaded correctly.
... however, while it may seem like this is a disadvantage, it's actually an advantage - if you make an
error you'll know immediately, and you should be able to easily figure out what the problem is by directly loading the file in firefox.
popChallengeResponse - Archive of obsolete content
the resultstring will either be a base-64 encoded popodeckeyrespcontent message, or one of the following
error strings:
error string description "
error:invalidparameter:xxx" the parameter xxx was an invalid value.
... "
error:internal
error" the software encountered some internal
error, such as out of memory challenge-response proof of possession expected input: popodeckeychallcontent ::= sequence of challenge -- one challenge per encryption key certification request (in the -- same order as these requests appear in fullcerttemplates).
Nanojit - Archive of obsolete content
compile(assm, f, *alloc verbose_only(, fragmento->labels)); if (assm->
error() != none) { fprintf(stderr, "
error compiling fragment\n"); return 1; } printf("compilation successful.\n"); // call the compiled function.
... compile(assm, f, *alloc verbose_only(, fragmento->labels)); if (assm->
error() != none) { fprintf(stderr, "
error compiling fragment\n"); return 1; } printf("compilation successful.\n"); // call the compiled function.
Porting NSPR to Unix Platforms - Archive of obsolete content
<tt>mozilla/nsprpub/pr/src/md/unix/netbsd.c</tt> you need to modify the following existing files: <tt>mozilla/nsprpub/pr/include/md/makefile</tt> <tt>mozilla/nsprpub/pr/include/md/_unixos.h</tt>: just fix the compiling
errors, usually pointed out by the <tt>#
error</tt> preprocessor directives we inserted.
... <tt>mozilla/nsprpub/pr/include/md/prosdep.h</tt> <tt>mozilla/nsprpub/pr/src/md/prosdep.c</tt> <tt>mozilla/nsprpub/pr/src/md/unix/makefile</tt> <tt>mozilla/nsprpub/pr/src/md/unix/objs.mk</tt> <tt>mozilla/nsprpub/pr/src/md/unix/unix.c</tt>: just fix the compiling
errors, usually pointed out by the <tt>#
error</tt> preprocessor directives we inserted for a pthreads port, you need to modify the following files: <tt>mozilla/nsprpub/pr/include/md/_pth.h</tt> files in mozilla/nsprpub/pr/src/pthreads, most likely <tt>ptthread.c</tt> and <tt>ptio.c</tt> testing your port we have some unit tests in <tt>mozilla/nsprpub/pr/tests</tt>.
File object - Archive of obsolete content
file.currentdir a file object that represents the standard
error (stderr).
...file.input, file.output, file.
error or a pipeline) methods file.open() opens the file, specifying file mode and type.
Running Tamarin performance tests - Archive of obsolete content
.sh /data/app/android_runner.s $ adb shell chmod 777 /data/app/android_runner.sh test it out with a simple .abc or no args for usage (should return exitcode=0) $ tamarin-redux/platform/android/android_shell.h hello.abc hello exitcode=0 running performance tests to run performance tests on android you don't need to pass --androidthreads or --threads=1 as with the acceptance tests; in fact, a usage
error will result.
... $ cd /test/performance $ ./runtests.py note on using an emulator: the emulator does seem to support hardware floating point but gives a bus
error when running avmshell -darm_vfp.
Tamarin build documentation - Archive of obsolete content
alternatively, run make, in which case the process will complete with
errors when it tries to create the shared lib crt0.o: $ /android-public/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/darwin-x86/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: crt0.o: no such file: no such file or directory collect2: ld returned 1 exit status make[2]: *** [link_app.]
error 1 make[1]: *** [openssl]
error 2 make: *** [build_apps]
error 1 you can ignore these
errors.
... note: if you receive an
error when trying to run/debug a newly imported project, try opening a file in the project first - eclipse can sometimes get confused as to what the 'current project' actually is.
Tamarin Build System Documentation - Archive of obsolete content
if an
error or failure occurs on any slave in a phase the build stops.
... the compile phase compiles all of the tamarin source code and builds all of the shell executables, any
errors will stop the phase and a red box will appear on the slave where the
error occurred.
URIs and URLs - Archive of obsolete content
also to be somewhat tolerant to syntax
errors the parser has to know more about the specific syntax of the urls for that scheme.
...validating parsers should mark such a misformed relative reference as an
error.
Writing textual data - Archive of obsolete content
the last argument to init specifies that: 0x0000 means that writing unsupported characters throws an exception (with an
error code of ns_
error_loss_of_significant_data), and no data will be written.
... note: if the replacement character is not a supported character in the chosen character encoding, attempts to write unsupported characters will fail with ns_
error_loss_of_significant_data.
addFile - Archive of obsolete content
returns an integer
error code.
...example var xpisrc = "file.txt"; initinstall("adding a file", "addfile", "1.0.1.7", 1); f = getfolder("program"); setpackagefolder(f); addfile(xpisrc); if (0 == getlast
error()) performinstall(); else cancelinstall(); ...
execute - Archive of obsolete content
returns an integer
error code.
...if you do not set this flag and launch an executable that is not a part of the installation, you will raise an
error when you restart the browser.
Accessing Files - Archive of obsolete content
other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related
error codes.
...on other platforms, using this value will just result in an
error.
Getting File Information - Archive of obsolete content
other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related
error codes.
...otherwise, an attempt to write to the file will generate an
error.
IO - Archive of obsolete content
other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related
error codes.
...file
errors see file
errors for a list of
errors that might occur while using files.
Textbox (XPFE autocomplete) - Archive of obsolete content
arch, autocompletesearchparam, autofill, autofillaftermatch, autofill, completedefaultindex, crop, disableautocomplete, disableautocomplete, disabled, disablehistory, enablehistory, focused, forcecomplete, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, ignoreblurwhilesearching, inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, minresultsforpopup, nomatch, onchange, on
errorcommand, oninput, onsearchcomplete, ontextcommand, ontextentered, ontextrevert, ontextreverted, open, readonly, searchsessions, showcommentcolumn, showcommentcolumn, showpopup, size, tabindex, tabscrolling, tabscrolling, timeout, type, useraction, value properties accessible, alwaysopenpopup, autofill, autofillaftermatch, completedefaultindex, crop, disableautocomplete, disabled, e...
... id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> function myfunction(e){ /* do something cool here or just say the below */ alert(e.target.nodename); } </script> <textbox id="find-text" onchange="return myfunction(event);"/> </window> on
errorcommand type: script code this event handler is called when an
error occurs when selecting a result from the popup.
Custom toolbar button - Archive of obsolete content
copy the name from here and paste it, to avoid typing
errors: custom-toolbar-button@example.com perform the following steps in this new directory, creating two files and a directory there.
... advanced troubleshooting if you have some technical knowledge, then you can use the application's javascript console to see
error messages.
Creating a Window - Archive of obsolete content
below: window.open(url,windowname,flags); where the flags contains the flag "chrome" as in this example window.open("chrome://navigator/content/navigator.xul", "bmarks", "chrome,width=600,height=300"); if you are using firefox, try below: window.open("chrome://browser/content/places/places.xul", "bmarks", "chrome,width=600,height=300"); you can test lines of javascript like these in the
error console.
... choose tools –
error console, type a line of javascript, and press the evaluate button, or the return or enter key.
Creating an Installer - Archive of obsolete content
if the result is non-zero, an
error occured and the value is an
error code.
... function donefn ( name , result ){ if (result) alert("an
error occured: " + result); } var xpi = new object(); xpi["find files"] = "findfile.xpi"; installtrigger.install(xpi,donefn); the xpi archive note: if you want to create a new xulrunner application, extension, or theme, see bundles.
Manifest Files - Archive of obsolete content
if not, you will see an
error on a yellow background.
... the
error message "xml parsing
error: undefined entity" in your xul file can be caused by an
error in the manifest or in the jar file referenced by the manifest.
Modifying a XUL Interface - Archive of obsolete content
note that for all these functions, the object referred to by the variable referencechild or the variables newchild and oldchild must already exist or an
error occurs.
... likewise the object referred to by the variable child which is to be removed must already exist or an
error occurs.
XUL Questions and Answers - Archive of obsolete content
support for non-rdf datasources for xul template is planned (bug 321170): xml datasources (bug 321171) storage (sqlite) datasources (bug 321172) when loading an xslt stylesheet into an xml i get the
error: "
error loading stylesheet: an xslt stylesheet load was blocked for security reasons." that
error is from a security check that has been put up to safeguard against cross-site-scripting attacks.
... i get the
error: gecko minversion requirement not met.
XUL Coding Style Guidelines - Archive of obsolete content
disobeying them might not cause any parsing
error for now, however, it might cause future maintenance headache: convert html files to xul files.
...to make xul stream/file localizable, several guidelines are to be adopted to make the translation work easier and less
error-prone.
image - Archive of obsolete content
attributes on
error, onload, src, validate properties accessibletype, src style classes alert-icon,
error-icon, message-icon, question-icon examples <image src='firefoxlogo.png' width='135' height='130'/> attributes on
error type: script code this event is sent to an image element when an
error occurs loading the image.
...
error-icon class that adds an
error icon.
CommandLine - Archive of obsolete content
a66"); const class_name = "applicationnameclh"; const contract_id = "@example.com/applicationname/clh;1"; const cld_category = "m-applicationname"; var apphandler = { /* nsisupports */ queryinterface : function clh_qi(aiid) { if (aiid.equals(nsicommandlinehandler) || aiid.equals(nsifactory) || aiid.equals(nsisupports)) return this; throw components.results.ns_
error_no_interface; }, /* nsicommandlinehandler */ handle : function clh_handle(acmdline) { var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.notifyobservers(acmdline, "commandline-args-changed", null); }, helpinfo : " -test <value> a test at...
...tribute\n", /* nsifactory */ createinstance : function mdh_ci(aouter, aiid) { if (aouter != null) { throw components.results.ns_
error_no_aggregation; } return this.queryinterface(aiid); }, lockfactory : function mdh_lock(alock) { /* no-op */ } }; var apphandlermodule = { /* nsisupports */ queryinterface : function mod_qi(aiid) { if (aiid.equals(nsimodule) || aiid.equals(nsisupports)) return this; throw components.results.ns_
error_no_interface; }, /* nsimodule */ getclassobject : function mod_gch(acompmgr, acid, aiid) { if (acid.equals(class_id)) return apphandler.queryinterface(aiid); throw components.results.ns_
error_failure; }, registerself : function mod_regself(acompmgr, afilespec, alocation, a...
Using LDAP XPCOM with XULRunner - Archive of obsolete content
[] = moz_dll_prefix "mozldap" moz_dll_suffix; nsresult nsgetmodule(nsicomponentmanager* acompmgr, nsifile* alocation, nsimodule* *aresult) { nsresult rv; nscomptr<nsifile> libraries; rv = alocation->getparent(getter_addrefs(libraries)); if (ns_failed(rv)) return rv; nscomptr<nsilocalfile> library(do_queryinterface(libraries)); if (!library) return ns_
error_unexpected; library->setnativeleafname(ns_literal_cstring("libraries")); library->appendnative(ns_literal_cstring("dummy")); // loop through and load dependent libraries for (char const *const *dependent = kdependentlibraries; *dependent; ++dependent) { library->setnativeleafname(nsdependentcstring(*dependent)); prlibrary *lib; library->load(&lib); // 1) we...
... } library->setnativeleafname(ns_literal_cstring(krealcomponent)); prlibrary *lib; rv = library->load(&lib); if (ns_failed(rv)) return rv; nsgetmoduleproc getmoduleproc = (nsgetmoduleproc) pr_findfunctionsymbol(lib, ns_get_module_symbol); if (!getmoduleproc) return ns_
error_failure; return getmoduleproc(acompmgr, alocation, aresult); } then change your .mozconfig to add this line: ac_add_options --enable-extensions=ldapstub rebuild xulrunner.
2006-10-13 - Archive of obsolete content
nsapprunner.o compile
error: some_const not declared in scope compile
error while compiling first build.
... user was conservative on what libraries they used, but now they have a compile
error and can't make sense of it.
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.builds - september 30th to october 6th 2006 tb mozilla_1_8_branch build problem on mac os x (10.4.7, universal build) ludwig hügelschäfer stated that he has been encountering an
error when he executes a "make export" operation on thunderbird (part of the mozilla_1_8_branch) since september 15th.
... ../../dist/host/bin/host_xpidl -m header -w -i~mozilla/xpcom/base -i../../dist/idl -o _xpidlgen/nsiconsolelistener ~/mozilla/xpcom/base/nsiconsolelistener.idl gmake[2]: *** [_xpidlgen/nsiconsolelistener.h] bus
error gmake[2]: *** deleting file `_xpidlgen/nsiconsolelistener.h' gmake[1]: *** [export]
error 2 make: *** [all]
error 2:: on octorber 4th ludwig hügelschäfer responded to his original post with the solution to his own problem.
NPN_SetException - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary a plugin can call this function to indicate that a call to one of the plugin's npobjects generated an
error.
...<tt>message</tt> a utf-8 string describing the
error that occurred.
NPN_Write - Archive of obsolete content
this indicates that the browser encountered an
error while processing the data, so the plug-in should terminate the stream by calling npn_destroystream().
... note: you should actually handle
errors, which this example doesn't do.
NPP_StreamAsFile - Archive of obsolete content
if an
error occurs while retrieving the data or writing the file, fname may be null.
... if an
error occurs while retrieving the data or writing the file, the file name (fname) is null.
SAX - Archive of obsolete content
nsisax
errorhandler receive notification of
errors in the input stream.
...lewhitespace: function(whitespace) { // don't care }, startprefixmapping: function(prefix, uri) { // don't care }, endprefixmapping: function(prefix) { // don't care }, // nsisupports queryinterface: function(iid) { if(!iid.equals(components.interfaces.nsisupports) && !iid.equals(components.interfaces.nsisaxcontenthandler)) throw components.results.ns_
error_no_interface; return this; } }; start parsing the xml reader component can parse xml from a string, an nsiinputstream, or asynchronously via the nsistreamlistener interface.
.htaccess ( hypertext access ) - Archive of obsolete content
php_value auto_prepend_file "/real/path/to/file/functions.php" # adds function.php at the top of requested document php_value auto_append_file "/real/path/to/file/footer.php" # adds footer.html at bottom of requested document customized
error responses : user can be directed to different pages depending on the
error they caused or by the webserver.
...
errordocument 404 /notfound.html # redirects traffic to notfound.html in case of a 404
error errordocument 500 /serverr.html # redirects traffic to serverr.html in case of a 500 internal server
error for further information see this external article: redirect your traffic for
error handling.
Threats - Archive of obsolete content
a threat source is the cause of a threat, such as a hostile cyber or physical attack, a human
error of omission or commission, a failure of organization-controlled hardware or software, or other failure beyond the control of the organization.
... many threats against data and resources are possible because of mistakes—either bugs in operating system and applications that create exploitable vulnerabilities, or
errors made by end users and administrators.
Common Firefox theme issues and solutions - Archive of obsolete content
change the style rules: .playbutton[paused] {...} .mutebutton[muted] {...} to: .playbutton[paused="true"] {...} .mutebutton[muted="true"] {...}
error console warnings unknown namespace for videocontrols.css the
error console is reporting the following issue: warning: unknown namespace prefix 'html'.
...source file: chrome://global/skin/media/videocontrols.css the solution to this issue is to add the following name space to the second line of the file right after, and in addition to, the existing @namespace: @namespace html url("http://www.w3.org/1999/xhtml"); you can generate the
error console message by going to mozilla's mission page.
Browser Feature Detection - Archive of obsolete content
cellspacing="0">'); for (i = 0; i < features.length; i++) { if (features[i].supported) document.write('<tr><td>' + features[i].name + '<\/td><td>' + features[i].supported + '<\/td><\/tr>'); else document.write('<tr><td>' + features[i].name + '<\/td><td style="background-color:red">' + features[i].supported + '<\/td><\/tr>'); } document.write('<\/table>'); } var oldon
error = window.on
error; // suppress
error messages...
... window.on
error = null; document.write('<p><b> your browser ' + navigator.useragent + '<\/b><\/p>'); generatereport(document, 'domcore1', 'document'); generatereport(document, 'domcore2', 'document'); generatereport(document, 'domhtml', 'document'); generatereport(document.body.style, 'domcss1', 'document.body.style'); generatereport(document.body.style, 'domcss2', 'document.body.style'); window.on
error = oldon
error; see also browser detection and cross browser support comparison of layout engines web specifications supported in opera 9 what's new in internet explorer 7 (script) original document information author(s): (unknown) last updated date: updated march 16, 2003 copyright information: copyright © 2001-2003 netscape.
E4X - Archive of obsolete content
the difference between the two modes is that without the "e4x=1" mime type, any statement-level xml/html comment literals (<!--...-->) are ignored for backwards compatibility with the comment hiding trick, and cdata sections (<![cdata[...]]>) are not parsed as cdata literals (which leads to a js syntax
error in html since html's <script> element produces an implicit cdata section, and therefore cannot contain explicit cdata sections).
...you may get syntax
error "xml is a reserved identifier" (despite the xml being in a string).
Debug.msTraceAsyncCallbackCompleted - Archive of obsolete content
the possible values for status include: debug.ms_async_op_status_success debug.ms_async_op_status_canceled debug.ms_async_op_status_
error note: some debugging tools do not display the information sent to the debugger.
... }, function (
error) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_
error); debug.mstraceasynccallbackstarting(opid); }); debug.mstraceasynccallbackcompleted(); } function dosomethingasync() { return winjs.promise.as(true); } asyncwrapperfunction(); requirements supported in the internet explorer 11 standards document mode.
Debug - Archive of obsolete content
3 debug.ms_async_callback_status_
error the synchronous work item caused an
error in an asynchronous operation.
... 2 debug.ms_async_op_status_
error the asynchronous operation resulted in an
error.
GetObject - Archive of obsolete content
if no object of the specified type exists, an
error occurs.
...with a single-instance object, getobject always returns the same instance when called with the zero-length string ("") syntax, and it causes an
error if the pathname argument is omitted.
Object.prototype.watch() - Archive of obsolete content
class person { constructor(name, age) { this.watch('age', this._isvalidassignment.bind(this)); this.watch('name', this._isvalidassignment.bind(this)); this.name = name; this.age = age; } tostring() { return this.name + ', ' + this.age; } _isvalidassignment(id, oldval, newval) { if (id === 'name' && (!newval || newval.length > 30)) { throw new range
error('invalid name for ' + this); } if (id === 'age' && (newval < 0 || newval > 200)) { throw new range
error('invalid age for ' + this); } return newval; } } const will = new person('will', 29); console.log(will); // will, 29 try { will.name = ''; } catch (e) { console.log(e); } try { will.age = -4; } catch (e) { console.log(e); } this script displays the follow...
...ing: will, 29 range
error: invalid name for will, 29 range
error: invalid age for will, 29 specifications not part of any standard.
handler.enumerate() - Archive of obsolete content
interceptions this trap can intercept these operations: property enumeration / for...in: for (var name in proxy) {...} reflect.enumerate() invariants if the following invariants are violated, the proxy will throw a type
error: the enumerate method must return an object.
... var p = new proxy({}, { enumerate(target) { return 1; } }); for (var x in p) {} // type
error is thrown note: both examples make use of the shorthand syntax for method definitions.
Examples - Archive of obsolete content
examples for "problems with inline style and script" problem 1 <!-- this file should have a .xhtml extension and will generate an
error when parsed.
...d> <dt>internet explorer 5.5+</dt> <dd>can not display the document.</dd> </dl> <p> <a href="http://validator.w3.org/check/referer"><img src="https://udn.realityripple.com/samples/8a/9e64asf935.png" alt="valid xhtml 1.0!" height="31" width="88" /></a> </p> </body> </html> back to the article problem 3 <!-- this file should have a .xhtml extension and will generate an
error when parsed.
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
i did it that way because it's a lot less likely to trigger a situation where rounding
errors force the two floats to total more than 100% the width of the parent, as could happen if the floats' element boxes were made to total 50%.
...after a bit of fiddling to try to fix this, i decided that trying to overcome this
error in document flow wasn't worth the effort.
RDF in Mozilla FAQ - Archive of obsolete content
the following code illustrates its usage: // this is the object that will observe the rdf/xml load's progress var observer = { onbeginload: function(asink) {}, oninterrupt: function(asink) {}, onresume: function(asink) {}, onendload: function(asink) { asink.removexmlsinkobserver(this); alert("done!"); }, on
error: function(asink, astatus, a
errormsg) { alert("
error!
... " + a
errormsg); } }; // get the rdf service var rdf = components .classes["@mozilla.org/rdf/rdf-service;1"] .getservice(components.interfaces.nsirdfservice); // get the datasource.
Windows Media in Netscape - Archive of obsolete content
ppet that shows this: var player; try { if (window.activexobject) { player = new activexobject("mediaplayer.mediaplayer.1"); } else if (window.geckoactivexobject) { player = new geckoactivexobject("mediaplayer.mediaplayer.1"); } else { // plugin code using navigator.mimetypes player = navigator.mimetypes["application/x-mplayer2"].enabledplugin; } } catch(e) { // handle
error -- no wmp control // download: http://www.microsoft.com/windows/windowsmedia/download/default.asp } if (player) { // windows media player control exists } currently, dynamically writing out markup using document.write after using detection mechanisms won't work owing to a bug in netscape 7.1.
...for the sake of brevity, we've made the following code snippet shorter to illustrate the relevant points about the api: var player; try { if(window.activexobject) { player = new activexobject("wmplayer.ocx.7"); } else if (window.geckoactivexobject) { player = new geckoactivexobject("wmplayer.ocx.7"); } } catch(e) { // handle
error -- no wmp 7 or 9 control // can use wmp 6 also if necessary, but this is legacy software nowadays } if (player) { // windows media player control exists and it is version 7 or 9 // can use wmp 7 or 9 api -- call versioninfo property, only in 7 and 9 var versionstring = player.versioninfo; alert(versionstring); } only geckoactivexobject allows for the use of the windows media play...
UDP (User Datagram Protocol) - MDN Web Docs Glossary: Definitions of Web-related terms
if
error-correction facilities are needed at the network interface level, an application may use the transmission control protocol (tcp) or stream control transmission protocol (sctp) which are designed for this purpose.
... udp is suitable for purposes where
error checking and correction are either not necessary or are performed in the application; udp avoids the overhead of such processing in the protocol stack.
How CSS works - Learn web development
it will do this if you have made an
error and misspelled a property or value, or if the property or value is just too new and the browser doesn't yet support it.
...it means that you can use new css as an enhancement, knowing that no
error will occur if it is not understood — the browser will either get the new feature or not.
HTML basics - Learn web development
failing to add a closing tag is one of the standard beginner
errors and can lead to strange results.
...in the mists of time, when html was young (around 1991/92), doctypes were meant to act as links to a set of rules that the html page had to follow to be considered good html, which could mean automatic
error checking and other useful things.
Tips for authoring fast-loading HTML pages - Learn web development
first, browsers will have no need to perform
error-correction when parsing the html (this is aside from the philosophical issue of whether to allow format variation in user input and then programmatically "correct" or normalize it; or whether, instead, to enforce a strict, no-tolerance input format).
...for example, html tidy can remove whitespace and optional ending tags; however, it will refuse to run on a page with serious markup
errors.
Choosing the right approach - Learn web development
failure callbacks need to be called once for each level of nesting, whereas with promises you can just use a single .catch() block to handle the
errors for the entire chain.
... when your code has the potential to take longer to run than the time interval you’ve assigned, it’s better to use recursive settimeout() — this will keep the time interval constant between executions regardless of how long the code takes to execute, and you won't get
errors.
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
you'll probably want a way to stop such tasks, otherwise you may end up getting
errors when the browser can't complete any further versions of the task, or if the animation being handled by the task has finished.
... when your code has the potential to take longer to run than the time interval you’ve assigned, it’s better to use recursive settimeout() — this will keep the time interval constant between executions regardless of how long the code takes to execute, and you won't get
errors.
Test your skills: Conditionals - Learn web development
note: in the examples below, if there is an
error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
...the different conditional tests (and resulting responses) are as follows: score of less than 0 or more than 100 — "this is not possible, an
error has occurred." score of 0 to 19 — "that was a terrible score — total fail!" score of 20 to 39 — "you know some things, but it's a pretty bad score.
Third-party APIs - Learn web development
}) to check whether each article has any images associated with it (some stories don't.) we display the first image only if it exists (otherwise an
error would be thrown).
... the second function works nearly exactly the same way in reverse, but we also have to take the extra step of checking that pagenumber is not already zero before decrementing it — if the fetch request runs with a minus page url parameter, it could cause
errors.
Test your skills: Strings - Learn web development
note: in the examples below, if there is an
error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
... you'll find that you get an
error at this point.
Test your skills: variables - Learn web development
note: in the examples below, if there is an
error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version).
... variables 3 the final task for now — in this case you are provided with some existing code, which has two
errors present in it.
Inheritance in JavaScript - Learn web development
therefore running the above code will give an
error: uncaught reference
error: must call super constructor in derived class before accessing 'this' or returning from derived constructor for sub-classes, the this intialization to a newly allocated object is always dependant on the parent class constructor, i.e the constructor function of the class from which you're extending.
...without using this convention, we would get
errors every time we called get or set.
Framework main features - Learn web development
if we were to use this function and pass '2' into it as an argument, typescript would raise an
error during compilation, and we would be forced to fix our mistake.
... we could write our own javascript that raises these
errors for us, but it would make our source code significantly more verbose.
Working with Svelte stores - Learn web development
this is a perfect example of how svelte puts the compiler in charge of better developer ergonomics, not only saving us from typing boiler plate, but also generating less
error-prone code.
...for security reasons the svelte repl works in a sandboxed environment which will not let you access web torage, and you will get a "the operation is insecure"
error.
Accessibility API cross-reference
this is for expandable items that are not expanded, such as folded tree branches or accordions collapsed collapsed collapsed aria-expanded=false different from xul's collapsed="true" attribute which indicates something is hidden this is the default button or menu item default n/a n/a identifies the element that provides an
error message for the object.
... n/a n/a aria-
errormessage an item that has been expanded, such as a tree item or accordion expanded expanded expanded aria-expanded=true indicates this object allows progressive disclosure of its children.
Accessibility information for UI designers and developers
error recovery when you detect users provide unexpected input, explain what is wrong and, if possible, how to correct it.
... this is specifically important in these cases: the user input is about legal commitments or financial transactions it updates or removes the user's data in a system when recording tests responses in those cases, ensure users can change submissions, automatically check for
errors.
Command line options
-jsconsole start application with the
error console, or, in firefox, the browser console.
... other options need to be documented -print-xpcom-dir -print-xpcom-dirlist -kill -killall -f -ftimeout -fwait -unsetdefaultmail gtk options -no-deelevate (running windows as administrator with launcher process enabled causes drag and drop
errors - how to fix) references chrome: command line test documentation for command-line features (mozilla.org) toolkit/xre/nsapprunner.cpp browser/components/nsbrowsercontenthandler.js suite/browser/nsbrowsercontenthandler.js mail/components/nsmaildefaulthandler.js installer command line options original document information author(s): ben goodger, steffen wilberg, seth spitzer, danie...
Creating a Language Pack
while in that directory, issue the following command: $ make merge-x-testing locale_mergedir=$(pwd)/mergedir x-testing: browser chrome browser aboutcert
error.dtd // add and localize this file ...
...issue the following command: $ make merge-x-testing locale_mergedir=$(pwd)/mergedir rm -f -rf mergedir macosx_deployment_target= compare-locales -m mergedir /users/your_id/mozilla/vc/mozilla-aurora/browser/locales/l10n.ini /users/your_id/mozilla/vc/l10n-central x-testing x-testing: browser chrome browser aboutcert
error.dtd // add and localize this file ...
Configuring Build Options
this will help catch any
errors introduced into the js code, with less of a performance impact compared to the --enable-debug option.
...after enabling the crash reporter in your local build, you will need to run mach with the --enable-crash-reporter (note the extra dash) to enable it at runtime, like so: `./mach run --enable-crash-reporter` ac_add_options --enable-warnings-as-
errors this makes compiler warnings into
errors which fail the build.
Simple Instantbird build
on linux, this can manifest as problems setting up the virtualenv for running tests (failure to install pip or virtualenv because of os access denied
errors, where access is denied not because of permission problems, but because the paths being accessed have been truncated, and so do not exist).
... try asking in mozilla.dev.chat - don't forget to include details of what is in your mozconfig, and what the actual
error is.
Windows SDK versions
note that if you're running a 64 bit version of windows you may require the "amd" version of the sdk even if you have an intel processor, and you may need to deselect the documentation component in the installer in order to avoid an installation
error.
... (this was certainly the case for 64 bit windows 7 on a late 2008 macbook pro.) warning: due to a bug in windows 7 sdk, if you get "sdksetup encountered an
error: expecting path %systemroot% to represent a valid system volume"
error you may require to set environmental variable %windir% to something like "c:\windows" instead of "%systemroot%".
Commenting IDL for better documentation
@throws
error description the
error should be the actual name of the
error constant, in all caps.
... * * @throws ns_
error_failure unable to locate the requested quote.
Limitations of chrome scripts
if browser code tries an unsafe cpow operation, the browser will throw an exception and you'll see an "unsafe cpow usage forbidden”
error in the browser console.
...if you do, you'll get an
error.
HTMLIFrameElement.download()
its request.onsuccess handler handles the success case, and its request.on
error handler handles the failure case.
... examples var browser = document.queryselector('iframe'); var request = browser.download(foourl, { filename: 'foo.bin' }); request.onsuccess = function() { console.log("file downladed"); } request.on
error = function() { console.log("download
error"); } specification not part of any specification.
HTMLIFrameElement.getContentDimensions()
its request.onsuccess handler handles the success case, and its request.on
error handler handles the failure case.
... examples var browser = document.queryselector('iframe'); var request = browser.getcontentdimensions(); request.onsuccess = function() { console.log("page size:", request.result.width + "x" + request.result.height); } request.on
error = function() { console.log("download
error"); } specification not part of any specification.
HTMLIFrameElement.purgeHistory()
}); returns either a domrequest object that returns an onsuccess handler if the history is deleted, or an on
error handler if not.
... examples domrequest: var browser = document.queryselector('iframe'); var request = browser.purgehistory(); request.onsuccess = function() { console.log('history deleted!'); } request.on
error = function() { console.
error(this.
error.name); } promise: var browser = document.queryselector('iframe'); browser.purgehistory().then(function() { console.log('history deleted!'); }, function(
error) { console.
error(this.
error.name); }); specification not part of any specification.
How to get a stacktrace with WinDbg
if you are prompted for a command but don't see an
error about a crash, go back to the debug menu and press go.
... once the browser crashes, you will see an
error (such as "access violation") in the windbg command window.
IPDL Best Practices
send__delete__(this); } }; class protocolmanagerparent { public: pprotocolparent* allocpprotocol() { return new protocolparent(); } bool deallocpprotocol() { return true; } }; nsautoptr<pprotocolparent> parent = manager->sendpprotocolconstructor(); while this may look appealing as the ipdl logic is stuffed away in a sensible place, it breaks under
error conditions.
... specifically, because allocpprotocol and deallocpprotocol are asymmetric, if ipdl ends up shutting down the protocol tree due to an
error, the auto pointer will attempt to trigger protocol deletion a second time.
JavaScript-DOM Prototypes in Mozilla
it is not guaranteed to work or be
error-free in any implementation.
... here is an attempt to modify a host object: (function(){ try { image.prototype.src = 1; } catch(ex){ alert(ex); } })(); this demonstrates that the image constructor, a host object supported in nearly all browsers for mac and windows, has a prototype property, and that an attempt to modify the prototype's src - property results in an
error.
UpdateListener
method overview void oncompatibilityupdateavailable(in addon addon) void onnocompatibilityupdateavailable(in addon addon) void onupdateavailable(in addon addon, in addoninstall install) void onnoupdateavailable(in addon addon) void onupdatefinished(in addon addon, in integer
error) methods oncompatibilityupdateavailable() called when the update check found compatibility information for the application and platform version that the update check was being performed for.
... void onupdatefinished( in addon addon, in integer
error ) parameters addon the addon that was being checked for updates
error any
error from the update checkaddon ...
AsyncShutdown.jsm
used for debugging/
error reporting.
...used for providing more details when logging
errors or crashing.
DeferredTask.jsm
if a special operation or
error logging is needed on completion, it can be better handled from within the task itself, for example using a try/catch/finally clause in the task.
... instead, if you are going to delete the saved data from disk anyways, you might as well prevent any pending write from starting, while still ensuring that any write that is currently in progress terminates, so that the file is not in use any more: savedeferredtask.disarm(); savedeferredtask.finalize().then(() => os.file.remove(...)) .then(null, components.utils.report
error); ...
Download
error read only download
error when the download fails, this is set to a download
error instance indicating the cause of the failure.
... promise can be rejected with download
error if the download failed.
Interfacing with the Add-on Repository
installing the add-on the shownotification() routine displays a notification box offering to install the recommended add-on, if one was found, or reports an
error if the search failed: shownotification: function(prompt, button, installobj) { this.install = installobj; var box = popupnotifications.show(gbrowser.selectedbrowser, "sample-popup", prompt, null, /* anchor id */ { label: button, accesskey: "i", callback: function() { if (popupnotifications.install) { ...
... the pop-up callback function that gets called when the user clicks the button looks to see if there's a non-null addoninstall object reference; if it's null, then the pop-up is displaying an
error notification, so clicking the button simply dismisses the pop-up.
Following the Android Toasts Tutorial from a JNI Perspective
we want to wrap this in a try-catch statement so if any
errors occur we make sure to unload the classes and the java environment, this is good for performance.
...because we don't want to keep typing string signatures everywhere, we can end up with typos and hard to trace back
errors, we use the sig object.
JavaScript OS.Constants
error values eacces permission denied eagain resource temporarily unavailable ebadf bad file descriptor eexist file exists efault bad address efbig file too large einval invalid argument eio input/output
error eisdir is a directory eloop (not always available under windows) too ...
... o_excl raise an
error if o_creat is set and the file exists.
Webapps.jsm
path) _getappdir: function(aid) _writefile: function(apath, adata) dogetlist: function() doexport: function(amsg, amm) doimport: function(amsg, amm) doextractmanifest: function(amsg, amm) dolaunch: function (adata, amm) launch: function launch(amanifesturl, astartpoint, atimestamp, aonsuccess, aonfailure) close: function close(aapp) canceldownload: function canceldownload(amanifesturl, a
error) startofflinecachedownload: function(amanifest, aapp, aprofiledir, aisupdate) computemanifesthash: function(amanifest) updateapphandlers: function(aoldmanifest, anewmanifest, aapp) checkforupdate: function(adata, amm) doinstall: function doinstall(adata, amm) doinstallpackage: function doinstallpackage(adata, amm) pushcontentaction: function(windowid) popcontentaction: function(windowid) ...
...(aapp, aissigned, aislocalfileinstall) _saveetag: function(aisupdate, aoldapp, arequestchannel, ahash, amanifest) _checkorigin: function(aissigned, aoldapp, amanifest, aisupdate) _getids: function(aissigned, azipreader, aconverter, anewapp, aoldapp,) _checkforstoreidmatch: function(aisupdate, anewapp, astoreid, astoreversion) revertdownloadpackage: function(aid, aoldapp, anewapp, aisupdate, a
error) uninstall: function(amanifesturl) _promptforuninstall: function(adata) confirmuninstall: function(adata) denyuninstall: function(adata, areason = "
error_unknown_failure") getself: function(adata, amm) checkinstalled: function(adata, amm) getinstalled: function(adata, amm) getnotinstalled: function(adata, amm) geticon: function(adata, amm) getall: function(acallback) isreceipt: functio...
What every Mozilla translator should know
when you create a bug, if you want the person in charge of the l10n to follow up your bug you should cc: l10n@mozilla.com if you choose to make changes to your localization, you should make the changes local to your disk, push them to your hg repository on merucial, test the changes on a nightly/tinderbox build, fix any
errors if some are found and test again, and send the new changeset id as your "opt-in" revisions to the l10-drivers.
... l10n tinderbox when the color is green, it means that the build process has finished with no
errors.
MathML3Testsuite
when the markup is intentionally
errorous, the correct behavior is not defined by the recommendation and hence the tests are considered passed if there is no fatal
error (crash, etc).
... characters blocks symbols variants entitynames numericrefs utf8 general clipboard genattribs math presentation css dynamicexpressions generallayout scriptsandlimits tablesandmatrices tokenelements topics accents bidi elementarymathexamples embellishedop largeop linebreak nesting stretchychars whitespace torturetests
errorhandling original document information author(s): frédéric wang other contributors: last updated date: may 26, 2010 copyright information: portions of this content are © 2010 by individual mozilla.org contributors; content available under a creative commons license | details.
Mozilla Port Blocking
if a user attempts to access a uri on a blocked port, mozilla shows one of the following alerts to the user or in the
error console.
... "access to the port number given has been disabled for security reasons." "establishing a connection to an unsafe or otherwise banned port was prohibited" "0x804b0013 (ns_
error_port_access_not_allowed)" if your product or web site uses a port which is blocked by mozilla's default port blocking rules, you can either change the port of your service to a unblocked value (recommended if possible) or ask your mozilla users to enable the port.
Memory reporting
they are less
error-prone.
...this is a good thing, because computing sizes analytically doesn't count slop, and it is much more
error-prone than using moz_malloc_usable_size.
TraceMalloc
tk 476 2197708 341 2366564 -135 168856 9.32 nsmemcacherecord 843 45767 2328 124767 1485 79000 4.36 nstextnode 209 11704 1614 90384 1405 78680 4.34 htmlattributesimpl 482 14288 2824 88400 2342 74112 4.09 nsscanner 58 76824 94 146300 36 69476 3.83 nsscript
error 253 25070 842 91548 589 66478 3.67 nshtmldocument.mreferrer 177 21550 691 85460 514 63910 3.53 nshtmlvalue 139 7846 1215 68734 1076 60888 3.36 htmlcontentsink 6 4816 12 57782 6 52966 2.92 uncategorized.pl, which lists all the void* allocations (the ones that couldn't be catego...
... tracemallocopenlogfile(filename) - open a new log file and return its log file descriptor (or -1 on
error).
Optimizing Applications For NSPR
the nspr process creation api functions return an
error when invoked on windows 3.1.
... a file descriptor is not usable after an io operation on it fails with either <tt>pr_io_timeout_
error</tt> or <tt>pr_io_interrupt_
error</tt>.
Introduction to NSPR
each thread has a built-in per-thread
error number and
error string that are updated when nspr operations fail.
...when the target is interrupted, it is rescheduled from the point at which it was blocked, with a status
error indicating that it was interrupted.
PR_AttachSharedMemory
returns address where shared memory is mapped, or null if an
error occurs.
... retrieve the reason for the failure by calling pr_get
error and pr_getos
error.
PR_Connect
further information can be obtained by calling pr_get
error.
... pr_connect blocks until either the connection is successfully established or an
error occurs.
PR_Poll
the reason for the failure can be obtained by calling pr_get
error.
... out_flags a bitwise or of the following bit flags: pr_poll_read pr_poll_write pr_poll_except pr_poll_err: fd has an
error.
PR_Read
to get the reason for the failure, call pr_get
error.
... description the thread invoking pr_read blocks until it encounters an end-of-stream indication, some positive number of bytes (but no more than amount bytes) are read in, or an
error occurs.
PR_Recv
the reason for the failure can be obtained by calling pr_get
error.
... description pr_recv blocks until some positive number of bytes are transferred, a timeout occurs, or an
error occurs.
PR_RecvFrom
the reason for the failure can be obtained by calling pr_get
error.
...the operation blocks until one or more bytes are transferred, a timeout has occurred, or there is an
error.
PR_RmDir
the actual reason can be retrieved via pr_get
error.
...if the directory is not empty, pr_rmdir fails and pr_get
error returns the
error code pr_directory_not_empty_
error.
PR_Seek64
the
error code can then be retrieved with pr_get
error.
... description this is the idiom for obtaining the current location (expressed as a 64-bit integer) of the file pointer for the file descriptor fd: pr_seek64(fd, 0, pr_seek_cur) if the operating system can handle only a 32-bit file offset, pr_seek64 may fail with the
error code pr_file_too_big_
error if the offset parameter is out of the range of a 32-bit integer.
PR_Send
the reason for the failure can be obtained by calling pr_get
error.
... description pr_send blocks until all bytes are sent, a timeout occurs, or an
error occurs.
PR_SendTo
the reason for the failure can be obtained by calling pr_get
error.
...the calling thread blocks until all bytes are sent, a timeout has occurred, or there is an
error.
PR_StringToNetAddr
you can retrieve the reason for the failure by calling pr_get
error.
...otherwise, use of anything other than ipv4 dotted notation results in an
error.
PR_TransmitFile
if an
error occurs while sending the file, the pr_transmitfile_close_socket flag is ignored.
... the reason for the failure can be obtained by calling pr_get
error.
PR_Write
the reason for the failure is obtained by calling pr_get
error.
...note that if pr_write returns -1, some data (less than amount bytes) may have been written before an
error occurred.
NSS 3.12.9 release notes
new in nss 3.12.9 removed functions new ssl options new
error codes bugs fixed the following bugs have been fixed in nss 3.12.9.
... bug 596798: win_rand.c (among others) uses unsafe _snwprintf bug 597622: do not use the sec_
error_bad_info_access_location
error code for bad crl distribution point urls bug 619268: memory leaks in cert_changecerttrust and cert_savesmimeprofile bug 585518: addtrust qualified ca root serial wrong in certdata.txt trust entry bug 337433: need cert_findcertbynicknameoremailaddrbyusage bug 592939: expired cas in certdata.txt documentation <for a="" class="new " documentation="" href=...
NSS 3.16.2 release notes
new macros in sslerr.h ssl_
error_next_protocol_no_callback - an ssl
error code that means the next protcol negotiation extension was enabled, but the callback was cleared prior to being needed.
... ssl_
error_next_protocol_no_protocol - an ssl
error code that means the server supports no protocols that the client advertises in the alpn extension.
NSS 3.45 release notes
only relevant for clients that might have copied the unit test code verbatim bug 1550022 - ensure nssutil3 gets built on android bug 1528174 - chacha20poly1305 should no longer modify output length on failure bug 1549382 - don't leak in pkcs#11 modules if c_getslotinfo() returns
error bug 1551041 - fix builds using gcc < 4.3 on big-endian architectures bug 1554659 - add versioning to openbsd builds to fix link time
errors using nss bug 1553443 - send session ticket only after handshake is marked as finished bug 1550708 - fix gyp scripts on solaris sparc so that libfreebl_64fpu_3.so builds bug 1554336 - optimize away unneeded loop in mpi.c bug 1559906 - fipstest: use...
...sm bug 1558126 - tls_aes_256_gcm_sha384 should be marked as fips compatible bug 1555207 - helloretryrequestcallback return code for rejecting 0-rtt bug 1556591 - eliminate races in uses of pk11_setwrapkey bug 1558681 - stop using a global for anti-replay of tls 1.3 early data bug 1561510 - fix a bug where removing -arch xxx args from cc didn't work bug 1561523 - add a string for the new-ish
error ssl_
error_missing_post_handshake_auth_extension this bugzilla query returns all the bugs fixed in nss 3.45: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.45 compatibility nss 3.45 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.46 release notes
bugs fixed in nss 3.46 bug 1572164 - don't unnecessarily free session in nsc_wrapkey bug 1574220 - improve controls after
errors in tstcln, selfserv and vfyserv cmds bug 1550636 - upgrade sqlite in nss to a 2019 version bug 1572593 - reset advertised extensions in ssl_constructextensions bug 1415118 - nss build with ./build.sh --enable-libpkix fails bug 1539788 - add length checks for cryptographic primitives (cve-2019-17006) bug 1542077 - mp_set_ulong and mp_set_int should return
errors on bad values bug 1572791 - ...
...read out-of-bounds in der_decodetimechoice_util from sslexp_delegatecredential bug 1560593 - cleanup.sh script does not set
error exit code for tests that "failed with core" bug 1566601 - add wycheproof test vectors for aes-kw bug 1571316 - curve25519_32.c:280: undefined reference to `pr_assert' when building nss 3.45 on armhf-linux bug 1516593 - client to generate new random during renegotiation bug 1563258 - fips.sh fails due to non-existent "resp" directories bug 1561598 - remove -wmaybe-uninitialized warning in pqg.c bug 1560806 - increase softoken password max size to 500 characters bug 1568776 - output paths relative to repository in nss coverity bug 1453408 - modutil -changepw fails in fips mode if password is an empty string bug 1564727 - use a pss spki when possible for deleg...
NSS 3.51 release notes
bug 1611209 - correct swapped pkcs11 values of ckm_aes_cmac and ckm_aes_cmac_general bug 1612259 - complete integration of wycheproof ecdh test cases bug 1614183 - check if ppc __has_include(<sys/auxv.h>) bug 1614786 - fix a compilation
error for ‘getfipsenv’ "defined but not used" bug 1615208 - send dtls version numbers in dtls 1.3 supported_versions extension to avoid an incompatibility.
...ent signs: 'int' and 'unsigned long' in security/nss/lib/freebl/ecl/ecp_25519.c:88 bug 1609751 - add test for mp_int clamping bug 1582169 - don't attempt to read the fips_enabled flag on the machine unless nss was built with fips enabled bug 1431940 - fix a null pointer dereference in blake2b_update bug 1617387 - fix compiler warning in secsign.c bug 1618400 - fix a openbsd/arm64 compilation
error: unused variable 'getauxval' bug 1610687 - fix a crash on unaligned cmaccontext.aes.keyschedule when using aes-ni intrinsics this bugzilla query returns all the bugs fixed in nss 3.51: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.51 compatibility nss 3.51 shared libraries are backward compatible w...
NSS Sample Code Sample1
int initnss() { int rv = 0; secstatus s; s = nss_initreadwrite("."); if (s != secsuccess) rv = 1; //
error // for this example, we don't use database passwords pk11_initpin(pk11_getinternalkeyslot(), "", ""); return rv; } int main(int argc, char *argv[]) { int rv; server *server1 = 0; server *server2 = 0; // initialize nss rv = initnss(); if (rv) { cout << "initnss failed" << endl; goto done; } // create the first "server" server1 = new server("server1"); if (!server1 || s...
...we will need // to transfer the keys from the first server to this // one server2 = new server("server2"); if (!server2 || server2->init()) { cout << "server2 could not be created" << endl; rv = 1; //
error goto done; } // transfer the keys from server1 { secitem *wrappedenckey = 0; secitem *wrappedmackey = 0; secitem *pubkeydata = 0; // get the public key for server 2 so that it can // be sent to server 1 rv = server2->exportpublickey(&pubkeydata); if (rv) { cout << "exportpublickey failed" << endl; goto trans_done; } // send the public key to server 1 a...
NSS Sample Code Sample_2_Initialization of NSS
= null; char *p1 = null; secupwdata *pwdata = (secupwdata *) arg; if (pwdata->source == pw_fromfile) { return filepasswd(slot, retry, pwdata->data); } if (pwdata->source == pw_plaintext) { return pl_strdup(pwdata->data); } /* open terminal */ input = fopen("/dev/tty", "r"); if (input == null) { pr_fprintf(pr_stderr, "
error opening input terminal for read\n"); return null; } /* we have no password, so initialize database with one */ pr_fprintf(pr_stderr, "enter a password which will be used to encrypt your keys.\n" "the password should be at least 8 characters long,\n" "and should contain at least one non-alphabetic character.\n\n"); output = fopen("/dev/tty", "w"); if (o...
...utput == null) { pr_fprintf(pr_stderr, "
error opening output terminal for write\n"); return null; } for (;;) { if (p0) port_free(p0); p0 = getpassword(input, output, "enter new password: ", checkpassword); if (p1) port_free(p1); p1 = getpassword(input, output, "re-enter password: ", checkpassword); if (p0 && p1 && !port_strcmp(p0, p1)) { break; } pr_fprintf(pr_stderr, "passwords do not match.
NSS Sample Code Utilities_1
lename, &stbuf); return stbuf.st_size; } /* * readderfromfile */ secstatus readderfromfile(secitem *der, const char *infilename, prbool ascii) { secstatus rv = secsuccess; prfiledesc *infile = null; infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "failed to open file \"%s\" (%ld, %ld).\n", infilename, pr_get
error(), pr_getos
error()); rv = secfailure; goto cleanup; } if (ascii) { /* first convert ascii to binary */ secitem filedata; char *asc, *body; /* read in ascii data */ rv = filetoitem(&filedata, infile); asc = (char *)filedata.data; if (!asc) { pr_fprintf(pr_stderr, "unable to read data from input file\n"); ...
... } else { pr_fprintf(pr_stderr, "input has header but no trailer\n"); port_free(filedata.data); rv = secfailure; goto cleanup; } } else { body = asc; } /* convert to binary */ rv = atob_convertasciitoitem(der, body); if (rv) { pr_fprintf(pr_stderr, "
error converting ascii to binary %s\n", port_get
error()); port_free(filedata.data); rv = secfailure; goto cleanup; } port_free(filedata.data); } else { /* read in binary der */ rv = filetoitem(der, infile); if (rv) { pr_fprintf(pr_stderr, "
error converting der \n"); rv = secfa...
Initialize NSS database - sample 2
= null; char *p1 = null; secupwdata *pwdata = (secupwdata *) arg; if (pwdata->source == pw_fromfile) { return filepasswd(slot, retry, pwdata->data); } if (pwdata->source == pw_plaintext) { return pl_strdup(pwdata->data); } /* open terminal */ input = fopen("/dev/tty", "r"); if (input == null) { pr_fprintf(pr_stderr, "
error opening input terminal for read\n"); return null; } /* we have no password, so initialize database with one */ pr_fprintf(pr_stderr, "enter a password which will be used to encrypt your keys.\n" "the password should be at least 8 characters long,\n" "and should contain at least one non-alphabetic character.\n\n"); output = fopen("/dev/tty", "w"); if (o...
...utput == null) { pr_fprintf(pr_stderr, "
error opening output terminal for write\n"); return null; } for (;;) { if (p0) port_free(p0); p0 = getpassword(input, output, "enter new password: ", checkpassword); if (p1) port_free(p1); p1 = getpassword(input, output, "re-enter password: ", checkpassword); if (p0 && p1 && !port_strcmp(p0, p1)) { break; } pr_fprintf(pr_stderr, "passwords do not match.
FC_Initialize
ckr_device_
error we failed to create the oid tables, random number generator, or internal locks.
...the nss cryptographic module is in a fatal
error state.
NSS Tools certutil-tasks
nss security tools: certutil tasks newsgroup: mozilla.dev.tech.crypto task list better
error reporting.
... most certutil
errors provide no detail.
Installing Pork
if you run simply "make install" and see file permission
errors, mcpp is likely trying to override your main gcc installation.
...a with mcpp to generate annotated .ii files, use the following configure command: ac_cv_visibility_hidden=no cc="gcc34 -save-temps -wp,-w0,-k" cxx="g++ -save-temps -wp,-w0,-k" cppflags=-dns_disable_literal_template $srcdir/configure --enable-debug --disable-optimize --disable-accessibility --enable-application=browser --disable-crashreporter building will probably require disabling warnings_as_
errors: make warnings_as_
errors= "-wp,-w0,-k" are options that get passed to mcpp.
Rhino shell
err - the process
error output instead of java.lang.system.err.
... if it is not instance of java.io.outputstream, the process
error output is read, converted to a string, appended to the err property value converted to string and put as the new value of the err property.
JS::Compile
used to report filename or url in
error messages.
...this information is included in
error messages if an
error occurs during compilation..
JS::Evaluate
used to report filename or url in
error messages.
...this information is used in messages if an
error occurs during compilation.
JS::SetOutOfMemoryCallback
this article covers features introduced in spidermonkey 31 specify a new callback function for out of memory
error.
...added in spidermonkey 38 description unlike the
error reporter, which is only called if the exception for an oom bubbles up and is not caught, the js::outofmemorycallback is called immediately at the oom site to allow the embedding to capture the current state of heap allocation before anything is freed.
JS::Value
js::value is not inherently type-safe it is an
error to call any accessor method on a value of a non-matching type: val.toint32() must only be called if val.isint32(), val.tostring() must only be called if val.isstring(), and so on.
... in particular, note that it is an
error to call val.toobject() when val.isnull().
JSObjectOps.getProperty
description get, set, or delete obj[id], returning js_false on
error or exception, js_true on success.
... if deleting without
error, *vp will be jsval_false if obj[id] is permanent, and jsval_true if id named a direct property of obj that was in fact deleted, or if id names no direct property of obj (id could name a property of a prototype, or no property in obj or its prototype chain).
JSPropertyOp
each of these callbacks may veto the ongoing property operation by optionally reporting an
error or raising an exception and then returning false.
... the operation then fails, and the
error is propagated to the caller.
JSProtoKey
oto_json json mxr search for jsproto_json jsproto_date date mxr search for jsproto_date jsproto_math math mxr search for jsproto_math jsproto_number number mxr search for jsproto_number jsproto_string string mxr search for jsproto_string jsproto_regexp regexp mxr search for jsproto_regexp jsproto_
error error mxr search for jsproto_
error jsproto_internal
error internal
error mxr search for jsproto_internal
error jsproto_eval
error eval
error mxr search for jsproto_eval
error jsproto_range
error range
error mxr search for jsproto_range
error jsproto_reference
error reference
error mxr search for jsproto_reference
error jspro...
...to_syntax
error syntax
error mxr search for jsproto_syntax
error jsproto_type
error type
error mxr search for jsproto_type
error jsproto_uri
error uri
error mxr search for jsproto_uri
error jsproto_iterator iterator mxr search for jsproto_iterator jsproto_stopiteration stopiteration mxr search for jsproto_stopiteration jsproto_arraybuffer arraybuffer mxr search for jsproto_arraybuffer jsproto_int8array int8array mxr search for jsproto_int8array jsproto_uint8array uint8array mxr search for jsproto_uint8array jsproto_int16array int16array mxr search for jsproto_int16array jsproto_uint16array uint16array mxr search for jsproto_uint16array ...
JSResolveOp
the callback must set *resolvedp to true and return true if the property is resolved, or set *resolvedp to false and return true if the object has no lazy property with the given id; or return false to indicate any other
error.
... obsolete since jsapi 36 the callback must return true if the property is resolved, or if the object has no lazy property with the given id; or false to indicate any other
error.
JS_AliasElement
if the property name you specify does not exist, js_aliaselement reports an
error, and returns js_false.
... if the element is currently out of scope, already exists, or the alias itself cannot be assigned to the element, js_aliaselement does not report an
error, but returns js_false.
JS_AliasProperty
if the property name you specify does not exist, js_aliasproperty reports an
error, and returns js_false.
... if the property is currently out of scope, already exists, or the alias itself cannot be assigned to the property, js_aliasproperty does not report an
error, but returns js_false.
JS_CompileUTF8FileHandle
this filename is used for
error messages.
...if an
error occurs during compilation, js_compileutf8filehandle stops reading from the file and returns null.
JS_ConvertValue
otherwise js_convertvalue reports an
error.
...on
error or exception, it returns false, and the value left in *vp is undefined.
JS_EncodeCharacters
on failure, *dstlenp receives the number of bytes written to dst before the
error occurred.
...otherwise it reports an
error and returns js_false.
JS_GetElement
if not, it sets *vp to undefined and returns true (to indicate no
error occurred).
... if the search fails with an
error or exception, js_getelement returns false, and the value left in *vp is undefined.
JS_GetProperty
if the lookup proceeds without
error, exactly one of the following cases applies: if the property is not found, then *vp is set to undefined.
...on an
error or exception, these functions return false, and the value left in *vp is undefined.
JS_HasArrayLength
this function differs from js_getarraylength in the treatment of
errors and unusual cases, like when an object's length is negative or not a number.
... this function may return js_false without having reported any
error or exception.
JS_HasElement
if not, it sets *foundp to false and returns true (to indicate no
error occurred).
... if the search fails with an
error or exception, js_haselement returns false, and the value left in *foundp is undefined.
JS_HasOwnProperty
if the object obj has no such property, the function sets *foundp to false and returns true (to indicate that no
error occurred).
... if an
error occurs during the search, the function returns false, and the value of *foundp is undefined.
JS_HasProperty
if the object obj has no such property, the function sets *foundp to false and returns true (to indicate that no
error occurred).
... if an
error occurs during the search, the function returns false, and the value of *foundp is undefined.
JS_InitStandardClasses
these include all the standard ecmascript global properties defined in ecma 262-3 §15.1: array, boolean, date, decodeuri, decodeuricomponent, encodeuri, encodeuricomponent,
error, eval, eval
error, function, infinity, isnan, isfinite, math, nan, number, object, parseint, parsefloat, range
error, reference
error, regexp, string, syntax
error, type
error, undefined, and uri
error as well as a few spidermonkey-specific globals, depending on compile-time options: escape, unescape, uneval, internal
error, script, xml, namespace, qname, file, generator, iterator, and stopiteratio...
... js_initstandardclasses returns js_true on success, and js_false if an
error occurs.
JS_LookupElement
if no such property exists, js_lookupelement sets *vp to undefined and returns true (to indicate that no
error occurred).
... on
error or exception, js_lookupelement returns false, and the value left in *vp is undefined.
JS_New
if ctor is not an object that can be used as a constructor, a type
error is raised.
...on
error, it returns null.
JS_SetElement
on
error or exception, js_setelement returns false.
...on
error or exception, js_setelement returns false and the value left in *vp is unspecified.
JS_ValueToFunction
if v is null, undefined, a boolean, a number, or a string, a type
error is reported and js_valuetofunction returns null.
...if conversion fails with an
error or exception, js_valuetofunction returns null.
JS_malloc
if allocation fails, an
error is reported in this context.
...if any of these three functions fails to allocate the required amount of memory, it reports an
error as though by calling js_reportoutofmemory(cx) and returns null.
Property attributes
in javascript 1.2 and lower, it is an
error to attempt to assign a value to a read-only property.
...in javascript 1.2 and lower, it is an
error to attempt to delete a permanent property.
SpiderMonkey 1.8.7
if you are running valgrind on your embedding, be sure to build spidermonkey with the --enable-valgrind option to suppress superflous
error messages triggered by the garbage collector.
...typed rooting api the rooting api has been changed from an
error-prone void ** interface to an interface which accepts pointers to specific types.
SpiderMonkey 1.8
when javascript 1.8 support is enabled, the parser accepts some incorrect programs by inserting a semicolon where it should instead throw a syntax
error (bug 384758).
... two new context options can be used with js_setoptions: jsoption_relimit, which causes extremely long-running regular expression searches to fail with an
error, and jsoption_anonfunfix, which bans anonymous functions from appearing anyplace where a statement could appear, such as in the argument to eval().
Pinning violation reports
if a site makes use of key pinning, and your browser sees a certificate chain for that site which does not match the pin, firefox will reject the connection and display an
error page.
... the
error page displayed by firefox when you encounter a pin violation gives you the option of reporting this
error.
Secure Development Guidelines
-designed api when using integers as array indexes, use caution format string bugs example: int main(int argc, char *argv[]) { if (argc > 1) printf(argv[1]); } format string bugs: prevention easy to fix: always use a format string specifier: int main(int argc, char *argv[]) { if (argc > 1) printf("%s", argv[1]); } double free example: void* ptr = malloc(1024); if (
error) { free(ptr); } free(ptr); double free: prevention set a pointer to null when it’s freed valgrind or malloc debugging can help detect those bugs use after free accessing data after a free() or delete can lead to undefined behavior some debug tools might be able catch some cases un-initialized data example: int main() { char *uninitialized_ptr; printf("0x%08x\r...
... memory leaks example: void *p; size_t new_size; p = realloc(p, new_size); if (p == null) { /* handle
error */ } memory leaks: prevention tools like valgrind can help detect memory leaks writing secure code: object management reference counting issues real-life example (bug 440230) void addref() { ++mrefcnt; ns_log_addref(this, mrefcnt, "nscssvalue::array", sizeof(*this)); } void release() { --mrefcnt; ns_log_release(this, mrefcnt, "nscssvalue::array"); if (mrefcnt == 0) delete this; } reference counting issues: prevention use the largest data type available on your platform for your reference counter ...
Places Developer Guide
}, queryinterface: function(iid) { if (iid.equals(ci.nsinavbookmarkobserver) || iid.equals(ci.nsisupports)) { return this; } throw cr.ns_
error_no_interface; }, }; // register the observer with the bookmarks service var bmsvc = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); bmsvc.addobserver(observer, false); // un-register the observer when done.
...e) { }, ondeleteuri: function(auri) { }, onclearhistory: function() { }, onpagechanged: function(auri, awhat, avalue) { }, onpageexpired: function(auri, avisittime, awholeentry) { }, queryinterface: function(iid) { if (iid.equals(components.interfaces.nsinavhistoryobserver) || iid.equals(components.interfaces.nsisupports)) { return this; } throw cr.ns_
error_no_interface; } }; history.addobserver(observer, false); new tagging service the tagging of uris is provided by nsitaggingservice.
Aggregating the In-Memory Datasource
}; very painful, prone to
errors, and fragile as the interfaces are still in flux (a wee bit).
...aresult) return ns_
error_null_pointer; if (aiid.equals(nscomtypeinfo<nsimyinterface>::getiid()) || aiid.equals(nscomtypeinfo<nsisupports>::getiid())) { *aresult = ns_static_cast(nsiglobalhistory*, this); } else if (aiid.equals(nscomtypeinfo<nsirdfdatasource>::getiid())) { return minner->queryinterface(aiid, aresult); } else { *aresult = nsnull; return ns_nointerface; } ns_addref(ns_s...
Component Internals
it is possible that xpcom will return an
error if you access the nsiservicemanager at that point, for example, so you may have to keep a reference-counted pointer to the service you are interested in using during this notification.
... the smart pointer class, nscomptr, for example, which makes reference counting less tedious and
error-prone, is not actually frozen, and neither is nsdebug, a class for aiding in tracking down bugs, nor is nsmemory, a class to ensure that everyone uses the same heap, generic factory, and module.
Introduction to XPCOM for the DOM
warning: this document has not yet been reviewed by the dom gurus, it might contain some
errors.
... return ns_ok; } ns_imethodimp nshtmldocument::getneat(prbool *aneat) { if(!aneat) { return ns_
error_null_pointer; } nsresult rv = fabian(); if( rv == ns_ok ) { *aneat = pr_true; } else { *aneat = pr_false; } return ns_ok; } this code is of course written in nshtmldocument.cpp.
Components.Exception
these exception objects may be thrown when implementing xpcom interfaces in javascript, and they can provide better diagnostics in the
error console if not caught than simply throwing an nsresult's value will.
... syntax var exception = [ new ] components.exception([ message [, result [, stack [, data ] ] ] ]); parameters message a string which can be displayed in the
error console when your exception is thrown or in other developer-facing locations, defaulting to 'exception' result the nsresult value of the exception, which defaults to components.results.ns_
error_failure stack an xpcom stack to be set on the exception (defaulting to the current stack chain) data any additional data you might want to store, defaulting to null example throw components.exception("i am throwing an exception from a javascript xpcom component."); ...
Components.isSuccessCode
components.issuccesscode() is functionally equivalent to the following javascript: function issuccesscode(returncode) { return (returncode & 0x80000000) === 0; } since failure
error codes are turned into exceptions when encountered in javascript, this function usually is not necessary.
... if (!components.issuccesscode(statuscode)) copyfailed = true; }, queryinterface: function(aiid) { if (aiid.equals(ci.nsirequestobserver) || aiid.equals(ci.nsisupports)) return this; throw cr.ns_
error_no_interface; } }; var copier = cc["@mozilla.org/network/async-stream-copier;1"] .createinstance(ci.nsiasyncstreamcopier); copier.init(instream, outstream, null, true, false, 8192, true, true); copier.asynccopy(copyobserver, null); } ...
Components.utils.cloneInto
add-on script can define an object, clone it, and pass it into this function: // add-on script var addonscriptobject = {"message" : "hello from add-on"}; contentwindow.foo(cloneinto(addonscriptobject, contentwindow)); // "they said: hello from add-on" cloning objects that have functions if the object to be cloned contains functions, you must pass the {clonefunctions:true} flag or you'll get an
error.
... {clonefunctions: true}); // page script var test = document.getelementbyid("test"); test.addeventlistener("click", function() { window.addonscriptobject.greetme(); }, false); cloning objects that contain dom elements by default, if the object you clone contains objects that are reflected from c++, such as dom elements, the cloning operation will fail with an
error.
nsISearchEngine
if null, will default to "text/html" exceptions thrown ns_
error_invalid_arg if name or value are null.
... ns_
error_failure if the search engine is read-only.
nsIStackFrame
this is the location that caused the
error, which may or may not be a source file location.
... for example, standard language
errors would generally have the same location as their top stack entry.
nsIToolkitProfile
nsiprofilelock lock( out nsiprofileunlocker aunlocker ); parameters aunlocker on
error, contains an nsiprofileunlocker object you can use to unlock the profile.
... note: the unlocker object cannot be returned to javascript as the
error causes an exception to be thrown.
nsITransportSecurityInfo
netwerk/socket/nsitransportsecurityinfo.idlscriptable this interface provides information about transport security, including the security state and any
error message for the connection.
... inherits from: nsisupports last changed in gecko 1.9 (firefox 3) attributes attribute type description
errormessage wstring
error message on connection failure.
nsIURLFormatter
if a variable is unknown, it is left unchanged and a non-fatal
error is reported.
...if the preference value cannot be retrieved, a fatal
error is reported and the "about:blank" url is returned.
nsIUTF8ConverterService
exceptions thrown ns_
error_uconv_noconv when there is no decoder for acharset or
error code of nsiunicodedecoder in case of conversion failure.
...exceptions thrown ns_
error_uconv_noconv when there is no decoder for acharset or
error code of nsiunicodedecoder in case of conversion failure.
nsIUUIDGenerator
exceptions thrown ns_
error_failure if a uuid cannot be generated (for example if an underlying source of randomness is not available) native code only!generateuuidinplace obtain a new uuid like the generateuuid() method, but place it in the provided nsid pointer instead of allocating a new nsid.
... exceptions thrown ns_
error_failure if a uuid cannot be generated (for example if an underlying source of randomness is not available) example generating a uuid var uuidgenerator = components.classes["@mozilla.org/uuid-generator;1"] .getservice(components.interfaces.nsiuuidgenerator); var uuid = uuidgenerator.generateuuid(); var uuidstring = uuid.tostring(); ...
nsIWeakReference
exceptions thrown ns_
error_null_pointer the referent no longer exists.
... ns_
error_no_interface the requested interface is not available.
nsIWebBrowser
ns_
error_invalid_arg one of the arguments was invalid or the object did not implement the interface specified by the iid.
... ns_
error_invalid_arg one of the arguments was invalid or the object did not implement the interface specified by the iid.
nsIWebBrowserPersist
exceptions thrown ns_
error_invalid_arg one or more arguments was invalid.
... exceptions thrown ns_
error_invalid_arg one or more arguments was invalid.
nsIWebSocketChannel
1002 close_protocol_
error the endpoint is terminating the connection due to a protocol
error.
...note: implementations should throw ns_
error_already_opened if the websocket connection is reopened.
nsIWebSocketListener
in the case of
errors, onstop() may be called without this method ever getting called.
...this event can be received in
error cases even if nsiwebsocketchannel.close() has not been called.
NS_ASSERTION
an assertion failure should be thrown on critical program
errors only.
...syntax ns_assertion(expressiontotest, "
error text"); see also ns_abort_if_false ns_precondition ns_postcondition disabling assertion dialog box on windows ...
NS ENSURE TRUE
syntax ns_ensure_true( expr, return-value ); usage nsresult mozmyclass::mozstringmucking() { char *foo = new char[123]; ns_ensure_true(foo, ns_
error_out_of_memory); // this is equivalent to doing: if (!foo) return ns_
error_out_of_memory; // thou shalt not return ns_
error_failure..
... int i = 3; ns_ensure_true(i == 3, ns_
error_failure); return ns_ok; } char* mozmyclass::dostuff() { char* bar = new char[321]; ns_ensure_true(bar, nsnull); return bar; } ...
NS_CStringToUTF16
otherwise, it returns an
error code.
... the set of possible
error codes is currently unspecified.
NS_UTF16ToCString
otherwise, it returns an
error code.
... the set of possible
error codes is currently unspecified.
Setting HTTP request headers
.getservice(components.interfaces.nsiobserverservice); os.addobserver(this, "http-on-modify-request", false); return; } }, queryinterface: function (iid) { if (iid.equals(components.interfaces.nsiobserver) || iid.equals(components.interfaces.nsisupports)) return this; components.returncode = components.results.ns_
error_no_interface; return null; }, }; var mymodule = { registerself: function (compmgr, filespec, location, type) { var compmgr = compmgr.queryinterface(components.interfaces.nsicomponentregistrar); compmgr.registerfactorylocation(this.mycid, this.myname, this.myprogid, ...
...actory; }, mycid: components.id("{9cf5f3df-2505-42dd-9094-c1631bd1be1c}"), myprogid: "@dougt/myhttplistener;1", myname: "simple http listener", myfactory: { queryinterface: function (aiid) { if (!aiid.equals(components.interfaces.nsisupports) && !aiid.equals(components.interfaces.nsifactory)) throw components.results.ns_
error_no_interface; return this; }, createinstance: function (outer, iid) { log("----------------------------> createinstance"); return new myhttplistener(); } }, canunload: function(compmgr) { return true; } }; function nsgetmodule(compmgr, filespec) { return mymodule; } privacy and security good practice a use case ...
Reference Manual
nscomptr<nsifoo> foo = ...; foo->addref(); //
error: |addref| is private delete foo.get(); //
error: |operator delete| is private ns_release(foo); //
error: |release| is private of course, the most important safety feature provided by nscomptr is that it addrefs and releases automatically at the appropriate times.
...t* ) if you can't satisfy the above promise, you can `annotate' the assignment to tell the nscomptr it needs to call queryinterface, e.g., nscomptr<nsifoo> foo( do_queryinterface(abarptr) ); // or foo = do_queryinterface(abarptr); // ..._will_ call |queryinterface| (and therefore, |addref|) // of course, since you're calling |queryinterface|, you might need the //
error result...
Using nsCOMPtr
after you've been using nscomptrs for a while, and you reach unfamiliar territory, or run into compiler
errors; you may want to return to this document to get help from the reference manual or the faq.
... contents status, recent changes, and plans recent changes to nscomptr getting started guide introduction using nscomptr summary reference manual the basics initialization and assignment using an nscomptr<t> as a t* efficiency and correctness compiler annoyances frequently asked questions buildtime
errors runtime
errors how do i...
wrappedJSObject
// constructor function helloworld() { }; helloworld.prototype = { hello: function() { return "hello world!"; }, queryinterface: function(aiid) { if (!aiid.equals(components.interfaces.nsisupports) && !aiid.equals(components.interfaces.nsihelloworld)) throw components.results.ns_
error_no_interface; return this; } }; xpconnect wrapping now let's get a reference to our component.
... in this example we use getservice, but as long as we get the reference from xpcom, our component gets wrapped by xpconnect in the same way: var comp = components.classes["@myself.com/my-component;1"].getservice(); if we try to call the hello() method we defined in our component implementation, we get: > comp.hello(); type
error on line 1: comp.hello is not a function this happens because, as we mentioned earlier, comp is not the helloworld js object itself, but an xpconnect wrapper around it: > dump(comp); [xpconnect wrapped nsisupports] the idea of these wrappers is to make the javascript-implemented xpcom components look just like any other xpcom component to the user.
XPIDL
attributes can be declared readonly, in which case setting causes an
error to be thrown in script contexts and native contexts lack the set method, by using the "readonly" keyword.
...clang and gcc) will reports
errors if these results are not used.
Account Provisioner
logs can either be dumped to the terminal via dump, or to the
error console.
... to have logs dumped to the
error console, create a string preference called mail.provider.logging.console and set its value to all.
Index
85
error reporting tools thunderbird currently, thunderbird tends to eat a lot of exceptions.
... some make it to the
error console, most don't.
Add to iPhoto
strcf = corefoundation.cfstringcreatewithcharacters(null, appstr, appstr.length); var appurl = corefoundation.cfurlcreatewithstring(null, appstrcf, null); corefoundation.cfrelease(appstrcf); var b = corefoundation.cfurlgetfsref(appurl, ref.address()); if (!b) { var stringsbundle = document.getelementbyid("string-bundle"); alert(stringsbundle.getstring('alert_download_
error_string')); } else { var array = ctypes.cast(mutablearray, corefoundation.cfarrayref); appservices.lsopenurlswithrole(array, 0, null, appparams.address(), null, 0); } corefoundation.cfrelease(appurl); // clean up corefoundation.cfrelease(array); } appservices.shutdown(); carbon.shutdown(); corefoundation.shutdown(); } this code begins by initializing al...
... if that fails, we display an
error; otherwise, we cast the cfmutablearrayref into a cfarrayref by calling ctypes.cast(), then call lsopenurlswithrole() to actually send the image to iphoto.
Using COM from js-ctypes
sid lpunknown, // punkouter dword, // dwclscontext refiid, // riid lpvoid // *ppv ); // helper functions function checkhresult(hr /*primative hresult*/, funcname /*jsstr*/) { // primative because thats what is returned by declared functions that // return hresult hr = hr.tostring(); // makes it primative if (hr < 0) { console.
error('hresult', hr, 'returned from function ', funcname /*, 'getstrofresult:', getstrofresult(hr)*/); throw new
error('hresult ' + hr + ' returned from function ' + funcname); } } let clsidfromarr = iidfromarr = function(jsarr_pieces) { let guid = guid(); // clsid and iid are same they are guid guid.data1 = parseint(jsarr_pieces[0], 16); guid.data2 = par...
... spvoiceptr.address()); checkhresult(primative_hr, "cocreateinstance"); spvoice = spvoiceptr.contents.lpvtbl.contents; let atext = 'hello firefox!'; let aflags = spf_default; primative_hr = spvoice.speak(spvoiceptr, atext, aflags, 0); checkhresult(primative_hr, "cocreateinstance"); } catch (ex) { console.
error('ex occured:', ex); } finally { if (spvoice) { spvoice.release(spvoiceptr); } couninitialize(); } } main(); lib.close(); other examples shgetpropertystoreforwindow - this examples shows that coinit is not needed, some winapi functions return the interface.
Working with ArrayBuffers
case 'netbsd': case 'dragonfly': lib = ctypes.open('libc.so'); break; case 'linux': lib = ctypes.open('libc.so.6'); break; case 'gnu/kfreebsd': lib = ctypes.open('libc.so.0.1'); break; default: //assume unix try { lib = ctypes.open(ctypes.libraryname('c')); } catch (ex) { throw new
error('i dont know where to memcpy is defined on your operating system, "' + os.constants.sys.name + '"'); lib.close(); } } try { var memcpy = lib.declare('memcpy', os.constants.sys.name.tolowercase().indexof('win') == 0 ?
... ctypes.winapi_abi : ctypes.default_abi, ctypes.void_t, // return ctypes.void_t.ptr, // *dest ctypes.void_t.ptr, // *src ctypes.size_t // count ); } catch (ex) { throw new
error('i dont know where to memcpy is defined on your operating system, "' + os.constants.sys.name + '"'); lib.close() } memcpy(myimgdat.data, pixelbuffer, myimgdat.data.length); // myimgdat.data.length is imgwidth * imgheight *4 because per pixel there is r, g, b, a numbers lib.close(); see also type conversion ...
FunctionType
the equivalent c function type declaration would be: returntype (*) ([argtype1, ..., argtypen]); exceptions thrown type
error abi is not a valid abi constants, or returntype or any of the argument types are not valid ctype objects.
... exceptions thrown type
error func is not either pointer value or javascript function.
Version, UI, and Status Information - Plugins
you should use a different method to display messages that the user needs to see, such as
error messages.
... bool has_windowless() { npbool supportswindowless = false; np
error ret = npn_getvalue(instance, npnvsupportswindowless, &supportswindowless); return ret == nperr_no_
error && supportswindowless; } reloading a plug-in when the browser starts up, it loads all the plug-ins it finds in the plugins directory for the platform.
Animation.finish() - Web APIs
examples the following example shows how to use the finish() method and catch an invalidstate
error.
... interfaceelement.addeventlistener("mousedown", function() { try { player.finish(); } catch(e if e instanceof invalidstate) { console.log("finish() called on paused or finished animation."); } catch(e); logmy
errors(e); //pass exception object to
error handler } }); the following example finishes all the animations on a single element, regardless of their direction of playback.
Animation.pause() - Web APIs
exceptions invalidstate
error the animation's currenttime is unresolved (for example, if it's never been played or isn't currently playing) and the end time of the animation is positive infinity.
... throws an invalidstate
error if the animation's currenttime is unresolved (perhaps it hasn't started playing yet) and the end time of the animation is positive infinity.
AudioBuffer() - Web APIs
exceptions notsupported
error one or more of the options are negative or otherwise has an invalid value (such as numberofchannels being higher than supported, or a samplerate outside the nominal range).
... range
error there isn't enough memory available to allocate the buffer.
AudioContext() - Web APIs
exceptions notsupported
error the specified samplerate isn't supported by the context.
... non-standard exceptions in chrome if the value of the latencyhint property isn't valid, chrome throws a type
error exception with the message "the provided value '...' is not a valid enum value of type audiocontextlatencycategory".
AudioWorkletGlobalScope.registerProcessor - Web APIs
return value undefined exceptions notsupported
error the name is an empty string, or a constructor under the given name is already registered.
... type
error the processorctor is not a callable constructor, or the parameterdescriptors property of the constructor exists and doesn't return an array of audioparamdescriptor-based objects.
AudioWorkletNode() - Web APIs
exceptions notsupported
error the specified options.outputchannelcount is 0 or larger than the current implementation supports.
... indexsize
error the length of options.outputchannelcount array does not match options.numberofoutputs.
AudioWorkletNodeOptions - Web APIs
if the number of inputs and number of outputs are both set to 0, a notsupported
error will be thrown and the node construction process aborted.
... if the length of the outputchannelcount array doesn't match numberofoutputs, an indexsize
error will be thrown.
AuthenticatorResponse - Web APIs
ionresponse var options = { challenge: new uint8array([/* bytes sent from the server */]) }; navigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { var assertionresponse = credentialinfoassertion.response; // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.
error(err); }); getting an authenticatorattestationresponse var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publ...
...ickey }) .then(function (newcredentialinfo) { var attestationresponse = newcredentialinfo.response; }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'authenticatorresponse interface' in that specification.
BaseAudioContext.createBuffer() - Web APIs
exceptions notsupported
error one or more of the options are negative or otherwise has an invalid value (such as numberofchannels being higher than supported, or a samplerate outside the nominal range).
... range
error there isn't enough memory available to allocate the buffer.
BaseAudioContext.createIIRFilter() - Web APIs
exceptions invalidstate
error all of the feedforward coefficients are 0, and/or the first feedback coefficient is 0.
... notsupported
error one or both of the input arrays exceeds 20 members.
BasicCardRequest - Web APIs
}) .catch(function(err) { // do something with the
error from request.show().
... }); } catch (e) { // catch any other
errors.
BasicCardResponse - Web APIs
}) .catch(function(err) { // do something with the
error from request.show().
... }); } catch (e) { // catch any other
errors.
CSSNumericValue.to() - Web APIs
exceptions syntax
error indicates that an invalid type was passed to the method.
... type
error indicates that the passed values cannot be summed.
Cache.add() - Web APIs
the add() method is functionally equivalent to the following: fetch(url).then(function(response) { if (!response.ok) { throw new type
error('bad response status'); } return cache.put(url, response); }) for more complex operations, you'll need to use cache.put() directly.
... exceptions exception happens when type
error the url scheme is not http or https.
Cache.put() - Web APIs
fetch(url).then(function(response) { if (!response.ok) { throw new type
error('bad response status'); } return cache.put(url, response); }) note: put() will overwrite any key/value pair previously stored in the cache that matches the request.
... note: the promise will reject with a type
error if the url scheme is not http or https.
CacheStorage - Web APIs
note: cachestorage always rejects with a security
error on untrusted origins (i.e.
...isourcache ) { continue; } caches.delete( key ); } } try { const data = await getdata(); console.log( { data } ); } catch (
error ) { console.
error( {
error } ); } specifications specification status comment service workersthe definition of 'cachestorage' in that specification.
ChildNode.after() - Web APIs
exceptions hierarchyrequest
error: node cannot be inserted at the specified point in the hierarchy.
... with(node) { after("foo"); } // reference
error: after is not defined polyfill you can polyfill the after() method in internet explorer 9 and higher with the following code: // from: https://github.com/jserz/js_piece/blob/master/dom/childnode/after()/after().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('after')) { return; } object.defineproperty(item, 'after', { configurable: true, ...
ChildNode.before() - Web APIs
exceptions hierarchyrequest
error: node cannot be inserted at the specified point in the hierarchy.
... with(node) { before("foo"); } // reference
error: before is not defined polyfill you can polyfill the before() method in internet explorer 9 and higher with the following code: // from: https://github.com/jserz/js_piece/blob/master/dom/childnode/before()/before().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('before')) { return; } object.defineproperty(item, 'before', { configurable: tr...
ChildNode.replaceWith() - Web APIs
exceptions hierarchyrequest
error: node cannot be inserted at the specified point in the hierarchy.
... with(node) { replacewith("foo"); } // reference
error: replacewith is not defined polyfill you can polyfill the replacewith() method in internet explorer 10+ and higher with the following code: function replacewithpolyfill() { 'use-strict'; // for safari, and ie > 10 var parent = this.parentnode, i = arguments.length, currentnode; if (!parent) return; if (!i) // if there are no arguments parent.removechild(this); while (i--) { // i...
Clipboard.write() - Web APIs
then write() is called, specifying both a fulfilment function and an
error function.
... example of copying canvas contents to the clipboard function copycanvascontentstoclipboard(canvas, ondone, on
error) { canvas.toblob(function (blob) { let data = [new clipboarditem({ [blob.type]: blob })]; navigator.clipboard.write(data).then(function () { ondone(); }, function (err) { on
error(err); }) }); } note: you can only pass in one clipboard item at a time.
ClipboardItem.types - Web APIs
if no clipboards contents is found for the specified type, an
error is returned.
... async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.
error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification.
CloseEvent - Web APIs
1002 protocol
error the endpoint is terminating the connection due to a protocol
error.
... 1011 internal
error the server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.
Crypto.getRandomValues() - Web APIs
exceptions this method can throw an exception under
error conditions.
... domexception (name: quotaexceeded
error) the requested length exceeds 65,536 bytes.
DOMLocator - Web APIs
note: this is not implemented in mozilla indicates a location such as where an
error occurred.
... returned by dom
error.location.
DOMMatrix - Web APIs
otherwise, a type
error exception is thrown.
...otherwise, a type
error exception is thrown.
Binary strings - Web APIs
however at least one native function requires binary strings as its input, btoa(): invoking it on a string that contains codepoints greater than 255 will cause a character out of range
error.
...however, this is slow and
error-prone, due to the need for multiple conversions (especially if the binary data is not actually byte-format data, but, for example, 32-bit integers or floats).
Document.exitFullscreen() - Web APIs
if an
error occurs while attempting to exit full-screen mode, the catch() handler for the promise is called.
... document.onclick = function (event) { if (document.fullscreenelement) { document.exitfullscreen() .then(() => console.log("document exited form full screen mode")) .catch((err) => console.
error(err)) } else { document.documentelement.requestfullscreen(); } } note: for a more complete example, see the example in element.requestfullscreen().
Document.querySelectorAll() - Web APIs
this string must be a valid css selector string; if it's not, a syntax
error exception is thrown.
... exceptions syntax
error the syntax of the specified selectors string is not valid.
Document Object Model (DOM) - Web APIs
dom interfaces attr cdatasection characterdata childnode comment customevent document documentfragment documenttype dom
error domexception domimplementation domstring domtimestamp domstringlist domtokenlist element event eventtarget htmlcollection mutationobserver mutationrecord namednodemap node nodefilter nodeiterator nodelist nondocumenttypechildnode parentnode processinginstruction selection range text textdecoder textencoder timeranges treewalker url window worker xmldocument ...
...it is uncertain whether some may be reintroduced in the future or not, but for the time being they should be considered obsolete and should be avoided: documenttouch domconfiguration dom
errorhandler domimplementationlist domimplementationregistry domimplementationsource domlocator domobject domsettabletokenlist domuserdata elementtraversal entity entityreference namelist notation typeinfo userdatahandler html dom a document containing html is described using the document interface, which is extended by the html specification to include v...
Element.attachShadow() - Web APIs
exceptions exception explanation invalidstate
error the element you are trying to attach to is already a shadow host.
... notsupported
error you are trying to attach a shadow root to an element outside the html namespace, or the element cannot have a shadow attached to it (see above).
Element.outerHTML - Web APIs
exceptions syntax
error an attempt was made to set outerhtml using an html string which is not valid.
... nomodificationallowed
error an attempt was made to set outerhtml on an element which is a direct child of a document, such as document.documentelement.
Element.querySelector() - Web APIs
syntax element = baseelement.queryselector(selectors); parameters selectors a group of selectors to match the descendant elements of the element baseelement against; this must be valid css syntax, or a syntax
error exception will occur.
... exceptions syntax
error the specified selectors are invalid.
Element.querySelectorAll() - Web APIs
this string must be a valid css selector string; if it's not, a syntax
error exception is thrown.
... exceptions syntax
error the syntax of the specified selectors string is not valid.
EventSource - Web APIs
event handlers eventsource.on
error is an eventhandler called when an
error occurs and the
error event is dispatched on an eventsource object.
... events
error fired when a connection to an event source failed to open.
ExtendableEvent - Web APIs
if waituntil() is called outside of the extendableevent handler, the browser should throw an invalidstate
error; note also that multiple calls will stack up, and the resulting promises will be added to the list of extend lifetime promises.
...resources to pre-fetch:', urlstoprefetch); event.waituntil( caches.open(current_caches['prefetch']).then(function(cache) { return cache.addall(urlstoprefetch.map(function(urltoprefetch) { return new request(urltoprefetch, {mode: 'no-cors'}); })).then(function() { console.log('all resources have been fetched and cached.'); }); }).catch(function(
error) { console.
error('pre-fetching failed:',
error); }) ); }); important: when fetching resources, it's very important to use {mode: 'no-cors'} if there is any chance that the resources are served off of a server that doesn't support cors.
Fetch basic concepts - Web APIs
when a request or response object is created, it has an associated headers object whose guard is set as summarized below: new object's type creating constructor guard setting of associated headers object request request() request request() with mode of no-cors request-no-cors response response() response
error() or redirect() methods immutable a header's guard affects the set(), delete(), and append() methods which change the header's contents.
... a type
error is thrown if you try to modify a headers object whose guard is immutable.
FileReader.readyState - Web APIs
a file or blob is being read, and no
error has occurred yet.
...this could mean that: the entire file or blob has been read into memory, a file read
error occurred, or abort() was called and the read was cancelled.
FileSystemEntry.isDirectory - Web APIs
if the entry is neither, an
error handler is called with an appropriate message.
... if (entry.isdirectory) { processsubdirectory(entry); } else if (entry.isfile) { processfile(entry); } else { display
errormessage("unsupported file system entry specified."); } specifications specification status comment file and directory entries apithe definition of 'isdirectory' in that specification.
FileSystemEntry.isFile - Web APIs
if the entry is neither, an
error handler is called with an appropriate message.
... if (entry.isdirectory) { processsubdirectory(entry); } else if (entry.isfile) { processfile(entry); } else { display
errormessage("unsupported file system entry specified."); } specifications specification status comment file and directory entries apithe definition of 'isfile' in that specification.
FileSystemFlags.create - Web APIs
false n/a[1] path exists but doesn't match the desired type the
errorcallback is called with an appropriate
error code (if the callback was provided).
... true true path exists the
errorcallback is called with an appropriate
error, such as file
error.path_exists_err.
FileSystemFlags.exclusive - Web APIs
false n/a[1] path exists but doesn't match the desired type the
errorcallback is called with an appropriate
error code (if the callback was provided).
... true true path exists the
errorcallback is called with an appropriate
error, such as file
error.path_exists_err.
FileSystemFlags - Web APIs
false n/a[1] path exists but doesn't match the desired type the
errorcallback is called with an appropriate
error code (if the callback was provided).
... true true path exists the
errorcallback is called with an appropriate
error, such as file
error.path_exists_err.
File and Directory Entries API - Web APIs
file
error represents an
error which is generated by asynchronous file system calls.
... fileexception represents an
error which is generated by synchronous file system calls.
FontFace.load - Web APIs
return value a promise that resolves with a reference to the current fontface object when the font loads or rejects with a network
error if the loading process fails.
... exceptions network
error indicates that the attempt to load the font failed.
FontFace.status - Web APIs
the status read-only property of the fontface interface returns an enumerated value indicating the status of the font, one of "unloaded", "loading", "loaded", or "
error".
... syntax var status = fontface.status; value one of "unloaded", "loading", "loaded", or "
error".
FontFace - Web APIs
fontface.loaded read only returns a promise that resolves with the current fontface object when the font specified in the object's constructor is done loading or rejects with a syntax
error.
... fontface.status read only returns an enumerated value indicating the status of the font, one of "unloaded", "loading", "loaded", or "
error".
Geolocation.clearWatch() - Web APIs
the geolocation.clearwatch() method is used to unregister location/
error monitoring handlers previously installed using geolocation.watchposition().
... example var id, target, option; function success(pos) { var crd = pos.coords; if (target.latitude === crd.latitude && target.longitude === crd.longitude) { console.log('congratulation, you reach the target'); navigator.geolocation.clearwatch(id); } }; function
error(err) { console.warn('
error(' + err.code + '): ' + err.message); }; target = { latitude : 0, longitude: 0, } options = { enablehighaccuracy: false, timeout: 5000, maximumage: 0 }; id = navigator.geolocation.watchposition(success,
error, options); specifications specification status comment geolocation api recommendation initial specification.
GlobalEventHandlers.oninvalid - Web APIs
html <form id="form"> <p id="
error" hidden>please fill out all fields.</p> <label for="city">city</label> <input type="text" id="city" required> <button type="submit">submit</button> </form> <p id="thanks" hidden>your data has been received.
... thanks!</p> javascript const form = document.getelementbyid('form'); const
error = document.getelementbyid('
error'); const city = document.getelementbyid('city'); const thanks = document.getelementbyid('thanks'); city.oninvalid = invalid; form.onsubmit = submit; function invalid(event) {
error.removeattribute('hidden'); } function submit(event) { form.setattribute('hidden', ''); thanks.removeattribute('hidden'); // for this example, don't actually submit the form event.preventdefault(); } result specification specification status comment html living standardthe definition of 'oninvalid' in that specification.
GlobalEventHandlers.onsubmit - Web APIs
html <form id="form"> <p id="
error" hidden>please fill out all fields.</p> <label for="city">city</label> <input type="text" id="city" required> <button type="submit">submit</button> </form> <p id="thanks" hidden>your data has been received.
... thanks!</p> javascript const form = document.getelementbyid('form'); const
error = document.getelementbyid('
error'); const city = document.getelementbyid('city'); const thanks = document.getelementbyid('thanks'); city.oninvalid = invalid; form.onsubmit = submit; function invalid(event) {
error.removeattribute('hidden'); } function submit(event) { form.setattribute('hidden', ''); thanks.removeattribute('hidden'); // for this example, don't actually submit the form event.preventdefault(); } result specifications specification status comment html living standardthe definition of 'onsubmit' in that specification.
HTMLFormElement.requestSubmit() - Web APIs
exceptions type
error the specified submitter is not a submit button.
... notfound
error the specified submitter isn't a member of the form on which requestsubmit() was called.
HTMLImageElement.complete - Web APIs
the image is "broken;" that is, the image failed to load due to an
error or because image loading is disabled.
... let lightboxelem = document.queryselector("#lightbox"); let lightboximgelem = lightboxelem.queryselector("img"); let lightboxcontrolselem = lightboxelem.queryselector(".toolbar"); async function loadimage(url, elem) { return new promise((resolve, reject) => { elem.onload = () => resolve(elem); elem.on
error = reject; elem.src = url; }); } async function lightbox(url) { lightboxelem.style.display = "block"; await loadimage("https://somesite.net/huge-image.jpg", lightboximgelem); lightboxcontrolselem.disabled = false; } /* ...
HTMLKeygenElement - Web APIs
setcustomvalidity(in domstring
error) void sets a custom validity message for the element.
... if this message is not the empty string, then the element is suffering from a custom validity
error, and does not validate.
HTMLOutputElement - Web APIs
if the element is not rendered, then the user agent may report the
error for the running script instead of notifying the user.
...if this message is not the empty string, then the element is suffering from a custom validity
error, and does not validate.
HTMLSelectElement.add() - Web APIs
exceptions a dom
error of the type hierarchyrequest
error if the item passed to the method is an ancestor of the htmlselectelement.
...it throws a dom
error of the type hierarchyrequest
error if the passed item is an ancestor of the htmlselectelement and no longer throws if the before parameter is not found.
HTMLSelectElement.setCustomValidity() - Web APIs
use the empty string to indicate that the element does not have a custom validity
error.
... syntax selectelt.setcustomvalidity(string); parameters string is the domstring containing the
error message.
HTMLTableRowElement - Web APIs
if the given position is greater (or equal as it starts at zero) than the amount of cells in the row, or is smaller than 0, it raises a domexception with the indexsize
error value.
...if the given position is greater (or equal as it starts at zero) than the amount of cells in the row, or is smaller than -1, it raises a domexception with the indexsize
error value.
HTMLTableSectionElement - Web APIs
if the given position is greater (or equal as it starts at zero) than the amount of rows in the section, or is smaller than 0, it raises a domexception with the indexsize
error value.
...if the given position is greater (or equal as it starts at zero) than the amount of rows in the section, or is smaller than -1, it raises a domexception with the indexsize
error value.
The HTML DOM API - Web APIs
audiotrack audiotracklist media
error texttrack texttrackcue texttrackcuelist texttracklist timeranges trackevent videotrack videotracklist drag and drop interfaces these interfaces are used by the html_drag_and_drop_api to represent individual draggable (or dragged) items, groups of dragged or draggable items, and to handle the drag and drop process.
... domstringlist domstringmap
errorevent htmlallcollection mimetype mimetypearray promiserejectionevent interfaces belonging to other apis several interfaces are technically defined in the html specification while actually being part of other apis.
Headers - Web APIs
note: all of the headers methods will throw a type
error if you try to pass in a reference to a name that isn't a valid http header name.
... the mutation operations will throw a type
error if the header has an immutable guard.
IDBDatabase.onabort - Web APIs
}; example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes on
error and onabort functions to handle non-success cases.
... dbopenrequest.onupgradeneeded = function(event) { var db = event.target.result; db.on
error = function() { note.innerhtml += '<li>
error opening database.</li>'; }; db.onabort = function() { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("not...
IDBDatabase.onversionchange - Web APIs
} example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes on
error and onabort functions to handle non-success cases, and an onversionchange function to notify when a database structure change has occurred.
... request.onupgradeneeded = function(event) { var db = event.target.result; db.on
error = function(event) { note.innerhtml += '<li>
error opening database.</li>'; }; db.onabort = function(event) { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex(...
IDBFactory.deleteDatabase() - Web APIs
if an
error occurs while the database is being deleted, then an
error event is fired on the request object that is returned from this method.
... example var dbdeleterequest = window.indexeddb.deletedatabase("todolist"); dbdeleterequest.on
error = function(event) { console.log("
error deleting database."); }; dbdeleterequest.onsuccess = function(event) { console.log("database deleted successfully"); console.log(event.result); // should be undefined }; specifications specification status comment indexed database api draftthe definition of 'deletedatabase()' in that specification.
IDBFactory - Web APIs
example in the following code snippet, we make a request to open a database, and include handlers for the success and
error cases.
... || window.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, so we don't need window.mozidb*) // let us open version 4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.on
error = function(event) { console.
error("
error loading database."); }; dbopenrequest.onsuccess = function(event) { console.info("database initialised."); // store the result of opening the database in the db variable.
IDBObjectStore.index() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstate
error the source object store has been deleted, or the transaction for the object store has finished.
... notfound
error there is no index with the given name (case-sensitive) in the database.
IDBObjectStore - Web APIs
db = dbopenrequest.result; }; // this event handles the event whereby a new version of // the database needs to be created either one has not // been created before, or a new version number has been // submitted via the window.indexeddb.open line above dbopenrequest.onupgradeneeded = function(event) { var db = event.target.result; db.on
error = function(event) { note.innerhtml += '<li>
error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false })...
... 19, minutes: 30, day: 24, month: 'december', year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.on
error = function(event) { note.innerhtml += '<li>transaction not opened due to
error.
IDBOpenDBRequest: blocked event - Web APIs
bubbles no cancelable no interface idbversionchangeevent event handler property onblocked examples using addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; db.on
error = () => { console.log('
error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createinde...
...n const req2 = indexeddb.open('todolist', 5); // in this case the onblocked handler will be executed req2.addeventlistener('blocked', () => { console.log('request was blocked'); }); }; using the onblocked property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; db.on
error = () => { console.log('
error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createinde...
IDBOpenDBRequest.onblocked - Web APIs
}; example var db; // let us open our database var request = indexeddb.open("todolist", 4); // these two event handlers act on the database being opened // successfully, or not request.on
error = function(event) { note.innerhtml += '<li>
error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...either one has not been created // before, or a new version number has been submitted via the // window.indexeddb.open line above //it is only implemented in recent browsers request.onupgradeneeded = function(event) { var db = event.target.result; db.on
error = function(event) { note.innerhtml += '<li>
error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); ...
IDBOpenDBRequest.onupgradeneeded - Web APIs
request.onupgradeneeded = function(event) { db = request.result; db.on
error = function(
errorevent) { note.innerhtml += '<li>
error loading database.</li>'; }; if (event.oldversion < 1) { // version 1 is the first version of the database.
... var magazines = db.createobjectstore("magazines"); var publisherindex = magazines.createindex("by_publisher", "publisher"); var frequencyindex = magazines.createindex("by_frequency", "frequency"); } }; request.on
error = function(event) { note.innerhtml += '<li>
error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; db = request.result; populateanddisplaydata(); }; specifications specification status comment indexed database api 2.0the definition of 'onupgradeneeded' in that specification.
IDBOpenDBRequest - Web APIs
dbopenrequest.on
error = function(event) { note.innerhtml += '<li>
error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable.
...list data already in the idb displaydata(); }; // this event handles the event whereby a new version of // the database needs to be created either one has not // been created before, or a new version number has been // submitted via the window.indexeddb.open line above // it is only implemented in recent browsers dbopenrequest.onupgradeneeded = function(event) { var db = this.result; db.on
error = function(event) { note.innerhtml += '<li>
error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false...
IDBRequest: success event - Web APIs
bubbles no cancelable no interface event event handler property onsuccess examples this example tries to open a database and listens for the success event using addeventlistener(): // open the database const openrequest = window.indexeddb.open('todolist', 4); openrequest.onupgradeneeded = (event) => { const db = event.target.result; db.on
error = () => { console.log('
error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createinde...
...ctstore.createindex('year', 'year', { unique: false }); }; openrequest.addeventlistener('success', (event) => { console.log('database opened successfully!'); }); the same example, but using the onsuccess event handler property: // open the database const openrequest = window.indexeddb.open('todolist', 4); openrequest.onupgradeneeded = (event) => { const db = event.target.result; db.on
error = () => { console.log('
error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createinde...
IDBTransaction: complete event - Web APIs
bubbles no cancelable no interface event event handler property oncomplete examples using addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.on
error = () => { console.log('
error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createinde...
...saction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2019 }; const objectstorerequest = objectstore.add(newitem); }; using the oncomplete property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.on
error = () => { console.log('
error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createinde...
IDBVersionChangeEvent.newVersion - Web APIs
example in the following code snippet, we make a request to open a database, and include handlers for the success and
error cases.
...kitidbtransaction || window.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, // so we don't need window.mozidb*) // let us open version 4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened dbopenrequest.on
error = function(event) { note.innerhtml += '<li>
error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
IDBVersionChangeEvent - Web APIs
example in the following code snippet, we make a request to open a database, and include handlers for the success and
error cases.
... || window.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, so we don't need window.mozidb*) // let us open version 4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.on
error = function(event) { note.innerhtml += '<li>
error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
ImageCapture - Web APIs
var imagecapture; function ongetusermediabuttonclick() { navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); }) .catch(
error => console.log(
error)); } function ongrabframebuttonclick() { imagecapture.grabframe() .then(imagebitmap => { const canvas = document.queryselector('#grabframecanvas'); drawcanvas(canvas, imagebitmap); }) .catch(
error => console.log(
error)); } function ontakephotobuttonclick() { imagecapture.takephoto() .then(blob => createimagebitmap(blob)) .then(imagebitmap => { cons...
...t canvas = document.queryselector('#takephotocanvas'); drawcanvas(canvas, imagebitmap); }) .catch(
error => console.log(
error)); } /* utils */ function drawcanvas(canvas, img) { canvas.width = getcomputedstyle(canvas).width.split('px')[0]; canvas.height = getcomputedstyle(canvas).height.split('px')[0]; let ratio = math.min(canvas.width / img.width, canvas.height / img.height); let x = (canvas.width - img.width * ratio) / 2; let y = (canvas.height - img.height * ratio) / 2; canvas.getcontext('2d').clearrect(0, 0, canvas.width, canvas.height); canvas.getcontext('2d').drawimage(img, 0, 0, img.width, img.height, x, y, img.width * ratio, img.height * ratio); } document.queryselector('video').addeventlistener('play', function() { document.queryselector('#grabframebutt...
Browser storage limits and eviction criteria - Web APIs
this will cause storage initialization to fail; for example, open() will fire an
error event.
... note: if the group limit is exceeded, or if origin eviction couldn't free enough space, the browser will throw a quotaexceeded
error.
Location: assign() - Web APIs
if the assignment can't happen because of a security violation, a domexception of the security_
error type is thrown.
... if the provided url is not valid, a domexception of the syntax_
error type is thrown.
Location: replace() - Web APIs
if the assignment can't happen because of a security violation, a domexception of the security_
error type is thrown.
... if the provided url is not valid, a domexception of the syntax_
error type is thrown.
MediaDevices - Web APIs
var video = document.queryselector('video'); var constraints = window.constraints = { audio: false, video: true }; var
errorelement = document.queryselector('#
errormsg'); navigator.mediadevices.getusermedia(constraints) .then(function(stream) { var videotracks = stream.getvideotracks(); console.log('got stream with constraints:', constraints); console.log('using video device: ' + videotracks[0].label); stream.onremovetrack = function() { console.log('stream ended'); }; window.stream = stream; // make v...
...ariable available to browser console video.srcobject = stream; }) .catch(function(
error) { if (
error.name === 'constraintnotsatisfied
error') {
errormsg('the resolution ' + constraints.video.width.exact + 'x' + constraints.video.height.exact + ' px is not supported by your device.'); } else if (
error.name === 'permissiondenied
error') {
errormsg('permissions have not been granted to use your camera and ' + 'microphone, you need to allow the page access to your devices in ' + 'order for the demo to work.'); }
errormsg('getusermedia
error: ' +
error.name,
error); }); function
errormsg(msg,
error) {
errorelement.innerhtml += '<p>' + msg + '</p>'; if (typeof
error !== 'undefined') { console.
error(
error); } } specifications specification s...
MediaRecorder.onwarning - Web APIs
the mediarecorder.onwarning event handler (part of the mediarecorder api) handles the recordingwarning event, allowing you to run code in response to non-fatal
errors being thrown during media recording via a mediarecorder, which don't halt recording.
... properties message contains information about the
error that occurred.
MediaRecorder.pause() - Web APIs
when a mediarecorder object’s pause()method is called, the browser queues a task that runs the below steps: if mediarecorder.state is "inactive", raise a dom invalidstate
error and terminate these steps.
... exceptions invalidstate
error the mediarecorder is currently "inactive"; you can't pause recording if it's not active.
MediaRecorder.requestData() - Web APIs
when the requestdata() method is invoked, the browser queues a task that runs the following steps: if mediarecorder.state is not "recording", raise a dom invalidstate
error and terminate these steps.
... syntax mediarecorder.requestdata()
errors an invalidstate
error is raised if the requestdata() method is called while the mediarecorder object’s mediarecorder.state is not "recording" — the media cannot be captured if recording is not occurring.
MediaRecorder.resume() - Web APIs
when the resume() method is invoked, the browser queues a task that runs the following steps: if mediarecorder.state is "inactive", raise a dom invalidstate
error and terminate these steps.
... syntax mediarecorder.resume()
errors an invalidstate
error is raised if the resume() method is called while the mediarecorder object’s mediarecorder.state is "inactive" — the recording cannot be resumed if it is not already paused; if mediarecorder.state is already "recording", resume() has no effect.
MediaRecorder.stop() - Web APIs
when the stop() method is invoked, the ua queues a task that runs the following steps: if mediarecorder.state is "inactive", raise a dom invalidstate
error and terminate these steps.
... syntax mediarecorder.stop()
errors an invalidstate
error is raised if the stop() method is called while the mediarecorder object’s mediarecorder.state is "inactive" — it makes no sense to stop media capture if it is already stopped.
MediaSource.duration - Web APIs
exception explanation invalidaccess
error an attempt was made to set a duration value that was negative, or nan.
... invalidstate
error mediasource.readystate is not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e.
MediaStreamAudioSourceNode() - Web APIs
exceptions invalidstate
error the specified mediastream doesn't have any audio tracks.
...sermedia ( // constraints: audio and video for this app { audio: true, video: false }).then(function(stream) { var options = { mediastream : stream } var source = new mediastreamaudiosourcenode(audioctx, options); source.connect(audioctx.destination); }).catch(function(err) { console.log('the following gum
error occured: ' + err); }); } else { console.log('new getusermedia not supported on your browser!'); } specifications specification status comment web audio apithe definition of 'mediastreamaudiosourcenode()' in that specification.
MediaStreamAudioSourceNode - Web APIs
exceptions invalidstate
error the stream specified by the mediastream parameter does not contain any audio tracks.
...st the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // get new mouse pointer coordinates when mouse is moved // then set new gain value range.oninput = function() { biquadfilter.gain.value = range.value; } }) .catch(function(err) { console.log('the following gum
error occured: ' + err); }); } else { console.log('getusermedia not supported on your browser!'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; note: as a consequence of calling createmediastreamsource(), audio playback from the media stream will be re-routed into the processing graph of the audiocontext.
Using the MediaStream Recording API - Web APIs
'); finally for this section, we set up the basic getusermedia structure: if (navigator.mediadevices && navigator.mediadevices.getusermedia) { console.log('getusermedia supported.'); navigator.mediadevices.getusermedia ( // constraints - only audio needed for this app { audio: true }) // success callback .then(function(stream) { }) //
error callback .catch(function(err) { console.log('the following getusermedia
error occured: ' + err); } ); } else { console.log('getusermedia not supported on your browser!'); } the whole thing is wrapped in a test that checks whether getusermedia is supported before running anything else.
... the
error/failure callback: the code is run if the getusermedia call fails for whatever reason.
MediaTrackSupportedConstraints - Web APIs
because of the way interface definitions in webidl work, if a constraint is requested but not supported, no
error will occur.
... instead, the specified constraints will be applied, with any unrecognized constraints stripped from the request.that can lead to confusing and hard to debug
errors, so be sure to use getsupportedconstraints() to retrieve this information before attempting to establish constraints if you need to know the difference between silently ignoring a constraint and a constraint being accepted.
Transcoding assets for Media Source Extensions - Web APIs
_00875.mp4 splitting media file (video) video_01250.mp4 splitting media file (video) video_01625.mp4 splitting media file (video) video_02000.mp4 $ tree -l 2 output output ├── audio │ └── und ├── stream.mpd └── video ├── 1 ├── 2 ├── 3 ├── 4 └── 5 8 directories, 1 file note: mp4-dash-encode.py does not display ffmpeg
error messages.
... note: if "invalid duration specification for force_key_frames: 'expr:eq(mod(n" is displayed as an
error message, modify mp4-dash-encode.py and remove two "'" from "-force_key_frames 'expr:eq(mod(n,%d),0)'".
Media Capture and Streams API (Media Stream) - Web APIs
it provides the interfaces and methods for working with the streams and their constituent tracks, the constraints associated with data formats, the success and
error callbacks when using the data asynchronously, and the events that are fired during the process.
... blobevent canvascapturemediastreamtrack inputdeviceinfo mediadevicekind mediadeviceinfo mediadevices mediastream mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints overconstrained
error url early versions of the media capture and streams api specification included separate audiostreamtrack and videostreamtrack interfaces—each based upon mediastreamtrack—which represented streams of those types.
MerchantValidationEvent() - Web APIs
exceptions type
error the string specified as validationurl could not be parsed as a url.
... range
error the specified methodname does not correspond to a known and supported merchant or is not a well-formed standard payment method identifier.
NDEFReader - Web APIs
ndefreader.on
error an event handler for
error event which is called to notify that an
error occured during reading.
... ndefreader.scan() called to activate the reader (after ensuring hardware and ua compatibility and obtaining permission from the user) or get an
error explaining why feature is not available.
Navigator.getBattery() - Web APIs
exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: security
error the user agent does not expose battery information to insecure contexts and this method was called from insecure context.
... notallowed
error note: no user agent currently throws this exception, but the specification describes the following behaviors: this document is not allowed to use this feature.
Navigator.share() - Web APIs
nt on mdn!', url: 'https://developer.mozilla.org', } const btn = document.queryselector('button'); const resultpara = document.queryselector('.result'); // must be triggered some kind of "user activation" btn.addeventlistener('click', async () => { try { await navigator.share(sharedata) resultpara.textcontent = 'mdn shared successfully' } catch(err) { resultpara.textcontent = '
error: ' + err } }); sharing files to share files, first test for and call navigator.canshare().
... if (navigator.canshare && navigator.canshare({ files: filesarray })) { navigator.share({ files: filesarray, title: 'pictures', text: 'our pictures.', }) .then(() => console.log('share was successful.')) .catch((
error) => console.log('sharing failed',
error)); } else { console.log(`your system doesn't support sharing files.`); } specifications specification status comment web share apithe definition of 'share()' in that specification.
Node.insertBefore() - Web APIs
se [ 2 ] : childelement is of type undefined let sp2 = undefined // non-existent node of id "childelement" parentdiv.insertbefore(newnode, sp2) // implicit dynamic cast to type node // end test case [ 2 ] // begin test case [ 3 ] : childelement is of type "undefined" ( string ) let sp2 = "undefined" // non-existent node of id "childelement" parentdiv.insertbefore(newnode, sp2) // generates "type
error: invalid argument" // end test case [ 3 ] </script> example 2 <div id="parentelement"> <span id="childelement">foo bar</span> </div> <script> // create a new, plain <span> element let sp1 = document.createelement("span") // get the reference element let sp2 = document.getelementbyid("childelement") // get the parent element let parentdiv = sp2.parentnode // insert the new element into bef...
... living standard fixes
errors in the insertion algorithm dom4the definition of 'node.insertbefore' in that specification.
Notification - Web APIs
notification.on
error a handler for the
error event.
... it is triggered each time the notification encounters an
error.
Using the Notifications API - Web APIs
error triggered if something goes wrong with the notification; this is usually because the notification couldn't be displayed for some reason.
... these events can be tracked using the onclick, onclose, on
error, and onshow handlers.
OfflineAudioContext.resume() - Web APIs
if the context is not currently suspended or the rendering has not started, the promise is rejected with invalidstate
error.
... invalidstate
error if the context is not currently suspended or the rendering has not started.
PaintWorklet.registerPaint - Web APIs
return value undefined exceptions type
error thrown when one of the arguments is invalid or missing.
... invalidmodification
error thrown when the a worklet already exists with the specified name.
PannerNode.PannerNode() - Web APIs
exceptions range
error the refdistance, maxdistance, or rollofffactor properties have been given a value that is outside the accepted range.
... invalidstate
error the coneoutergain property has been given a value outside the accepted range (0–1).
PannerNode.refDistance - Web APIs
if the value is set to less than 0, a range
error is thrown.
... exceptions range
error the property has been given a value that is outside the accepted range.
ParentNode.append() - Web APIs
exceptions hierarchyrequest
error: node cannot be inserted at the specified point in the hierarchy.
... let parent = document.createelement("div") with(parent) { append("foo") } // reference
error: append is not defined polyfill you can polyfill the append() method in internet explorer 9 and higher with the following code: // source: https://github.com/jserz/js_piece/blob/master/dom/parentnode/append()/append().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('append')) { return; } object.defineproperty(item, 'append', { configurable:...
ParentNode.prepend() - Web APIs
exceptions hierarchyrequest
error: node cannot be inserted at the specified point in the hierarchy.
... var parent = document.createelement("div"); with(parent) { prepend("foo"); } // reference
error: prepend is not defined polyfill you can polyfill the prepend() method if it's not available: // source: https://github.com/jserz/js_piece/blob/master/dom/parentnode/prepend()/prepend().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('prepend')) { return; } object.defineproperty(item, 'prepend', { configurable: true, enumerable: true,...
ParentNode.querySelector() - Web APIs
this string must be a valid compound selector list supported by the browser; if it's not, a syntax
error exception is thrown.
... exceptions syntax
error the syntax of the specified selectors string is not valid.
ParentNode.querySelectorAll() - Web APIs
this string must be a valid css selector string; if it's not, a syntax
error exception is thrown.
... exceptions syntax
error the syntax of the specified selectors string is not valid.
PaymentAddress.country - Web APIs
entifying the country in which the address is located, or an empty string if no country is available, which frequently can be assumed to mean "same country as the site owner." usage notes if the payment handler validates the address and determines that the value of country is invalid, a call to paymentrequestupdateevent.updatewith() will be made with a details object containing a shippingaddress
errors field.
... that field contains an address
errors-compliant object whose country property is a string indicating the validation
error that occurred and, if possible, suggests how to fix it.
PaymentResponse: payerdetailchange event - Web APIs
if any are invalid, appropriate
error messages should be configured and the retry() method should be called on the paymentresponse to ask the user to update the invalid entries.
...ame(payername)); oldpayername = payername; } if (oldpayeremail !== payeremail) { promisestovalidate.push(validateemail(payeremail)); oldpayeremail = payeremail; } if (oldpayerphone !== payerphone) { promisestovalidate.push(validatephone(payerphone)); oldpayerphone = payerphone; } // as each validation promise resolves, add the results of the // validation to the
errors list const
errors = await promise.all(promisestovalidate).then(results => results.reduce((
errors, result), object.assign(
errors, result)) ); // if we found any
errors, wait for them to be corrected if (object.getownpropertynames(
errors).length) { await response.retry(
errors); } else { // we have a good payment; send the data to the server await fetch("/pay-for-things...
PerformanceTiming - Web APIs
if the transport layer reports an
error and the connection establishment is started again, the last connection establishment start time is given.
...if the transport layer reports an
error and the connection establishment is started again, the last connection establishment end time is given.
PromiseRejectionEvent() - Web APIs
it also becomes easier to write a global handler for
errors.
...this can be anything from a numeric
error code to an
error domstring to an object which contains detailed information describing the situation resulting in the promise being rejected.
PublicKeyCredential - Web APIs
), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var response = newcredentialinfo.response; var clientextensionsresults = newcredentialinfo.getclientextensionresults(); }).catch(function (err) { console.
error(err); }); getting an existing instance of publickeycredential here, we fetch an existing credential from an authenticator, using navigator.credentials.get().
... var options = { challenge: new uint8array([/* bytes sent from the server */]) }; navigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'publickeycredential interface' in that specification.
PublicKeyCredentialRequestOptions.allowCredentials - Web APIs
if the authenticator does not contain any of these public key credentials, the client will throw a domexception "notallowed
error".
...: "public-key", id: new uint8array(26) // actually provided by the server } ], challenge: new uint8array([/* bytes sent from the server */]) }; navigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'allowcredentials' in that specification.
RTCDTMFSender.insertDTMF() - Web APIs
return value undefined exceptions invalidstate
error the dtmf tones couldn't be sent because the track has been stopped, or is in a read-only or inactive state.
... invalidcharacter
error one or more of the characters in tones is not valid dtmf.
RTCIceCandidate.protocol - Web APIs
protocol is null by default if not specified properly in the sdp, but this is an
error condition and will result in a thrown exception when you call rtcpeerconnection.addicecandidate().
... note: if protocol is null — and protocol is supported by the user agent — passing the candidate to addicecandidate() will fail, throwing an operation
error exception.
RTCIceCandidateInit.candidate - Web APIs
if your client-side signaling layer builds and transmits a json string including the candidate to the remote peer, the remote peer might handle receiving that json message like this: function goticecandidatemessage(msg) { var icecandidate = new rtcicecandidate({ candidate: msg.candidate; }); pc.addicecandidate(icecandidate).catch({ /* handle
error */ }); } it's helpful to note that for backward compatibility with older versions of the webrtc specification, the rtcicecandidate() constructor accepts the value of candidate as its only input, in place of the rtcicecandidateinit dictionary.
... that usage would change the above sample to look like this: function goticecandidatemessage(msg) { var icecandidate = new rtcicecandidate(msg.candidate); pc.addicecandidate(icecandidate).catch({ /* handle
error */ }); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidateinit.candidate' in that specification.
RTCInboundRtpStreamStats.fecPacketsDiscarded - Web APIs
the fecpacketsdiscarded property of the rtcinboundrtpstreamstats dictionary is a numeric value indicating the number of rtp forward
error correction (fec) packets that have been discarded.
... syntax var fecpacketsdiscarded = rtcinboundrtpstreamstats.fecpacketsdiscarded; value an unsigned integer value indicating how many fec packets have been received whose
error correction payload has been discarded.
RTCInboundRtpStreamStats.fecPacketsReceived - Web APIs
the fecpacketsreceived property of the rtcinboundrtpstreamstats dictionary indicates how many forward
error correction (fec) packets have been received by this rtp receiver from the remote peer.
...forward
error correction uses an exclusive-or method to perform parity checks on the received data.
RTCPeerConnection.addTrack() - Web APIs
exceptions invalidaccess
error the specified track (or all of its underlying streams) is already part of the rtcpeerconnection.
... invalidstate
error the rtcpeerconnection is closed.
RTCPeerConnection: negotiationneeded event - Web APIs
pc.addeventlistener("negotiationneeded", ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle
error */ ); }, false); after creating the offer, the local end is configured by calling rtcpeerconnection.setlocaldescription(); then a signaling message is created and sent to the remote peer through the signaling server, to share that offer with the other peer.
... you can also set an event handler for the negotiationneeded event by assigning the event handler function to the rtcpeerconnection.onnegotiationneeded property: pc.onnegotiationneeded = ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle
error */ ); }; for a more detailed example, see starting negotiation in signaling and video calling.
RTCPeerConnection.oniceconnectionstatechange - Web APIs
example the example below watches the state of the ice agent for a failure or unexpected closure and takes appropriate action, such as presenting an
error message or attempting to restart the ice agent.
... pc.oniceconnectionstatechange = function(event) { if (pc.iceconnectionstate === "failed" || pc.iceconnectionstate === "disconnected" || pc.iceconnectionstate === "closed") { // handle the failure } }; of course, "disconnected" and "closed" don't necessarily indicate
errors; these can be the result of normal ice negotiation, so be sure to handle these properly (if at all).
RTCRtpCapabilities - Web APIs
fec (forward
error correction) an fec component handles
error correction data; its media type may also vary due to there being advanced versions of the standard available, but it will always end with fec.
... one possible value is video/ulpfec (a generic
error connection model).
RTCRtpStreamStats - Web APIs
their primary purpose is to examine the
error resiliency of the connection, as they provide information about lost packets, lost frames, and how heavily compressed the data is.
...this is a fairly technical part of how codecs work and while the higher this value is, the more
errors occurred in the stream, generally most of the time this value is only interesting to very intensively hardcore media developers.
RTCRtpTransceiver.direction - Web APIs
exceptions when setting the value of direction, the following exceptions can occur: invalidstate
error either the receiver's rtcpeerconnection is closed or the rtcrtpreceiver is stopped.
... usage notes setting the direction when you change the value of direction, an invalidstate
error exception will occur if the connection is closed or the receiver is stopped.
RTCRtpTransceiver.setCodecPreferences() - Web APIs
return value undefined exceptions invalidaccess
error the codecs list includes one or more codecs which are not supported by the transceiver.
...if any unsupported codecs are listed, the browser will throw an invalidaccess
error exception when you call this method.
Range.setEnd() - Web APIs
exceptions exceptions are thrown as domexception objects of the following types: invalidnodetype
error the node specified by endnode is a doctype node; range endpoints cannot be located inside a doctype node.
... indexsize
error the value specified by endoffset is either greater than or equal to the length of the node or is less than zero.
ReadableStream.ReadableStream() - Web APIs
if pull() returns a promise, then it won't be called again until that promise fulfills; if the promise rejects, the stream will become
errored.
... exceptions range
error the supplied type value is neither "bytes" nor undefined.
ReadableStream.getReader() - Web APIs
exceptions range
error the provided mode value is not "byob" or undefined.
... type
error the stream you are trying to create a reader for is not a readablestream.
ReadableStreamBYOBReader.read() - Web APIs
if the stream becomes
errored, the promise will be rejected with the relevant
error.
... exceptions type
error the source object is not a readablestreambyobreader, the stream has no owner, the view is not an object or has become detached, or the view's length is 0.
ReadableStreamBYOBRequest.respond() - Web APIs
the
error() method of the readablestreambyobrequest interface xxx syntax readablestreambyobrequestinstance.respond(byteswritten); parameters byteswritten xxx return value void.
... exceptions type
error the source object is not a readablestreambyobrequest, or there is no associated controller, or the associated internal array buffer is detached.
ReadableStreamDefaultReader.read() - Web APIs
if the stream becomes
errored, the promise will be rejected with the relevant
error.
... exceptions type
error the source object is not a readablestreamdefaultreader, or the stream has no owner.
Request() - Web APIs
redirect: the redirect mode to use: follow,
error, or manual.
...
errors type description type
error since firefox 43, request() will throw a type
error if the url has credentials, such as http://user:password@example.com.
Response.redirect() - Web APIs
exceptions exception explanation range
error the specified status is not a redirect status.
... type
error the specified url is invalid.
SVGElement - Web APIs
error fired when an svg element does not load properly or when an
error occurs during script execution.
... also available via the on
error property.
SVGRect - Web APIs
svgrect.width this represents the width of the rectangle.a value that is negative results to an
error.
... a value of zero disables rendering of the element svgrect.height this represents the height of the rectangle.a value that is negative results to an
error.a value of zero disables rendering of the element.
Using server-sent events - Web APIs
error handling when problems occur (such as a network timeout or issues pertaining to access control), an
error event is generated.
... you can take action on this programmatically by implementing the on
error callback on the eventsource object: evtsource.on
error = function(err) { console.
error("eventsource failed:", err); }; closing event streams by default, if the connection between the client and server closes, the connection is restarted.
ServiceWorker - Web APIs
se if (registration.active) { serviceworker = registration.active; document.queryselector('#kind').textcontent = 'active'; } if (serviceworker) { // logstate(serviceworker.state); serviceworker.addeventlistener('statechange', function (e) { // logstate(e.target.state); }); } }).catch (function (
error) { // something went wrong during registration.
... the service-worker.js file // might be unavailable or contain a syntax
error.
SourceBuffer.appendWindowEnd - Web APIs
exception explanation invalidaccess
error an attempt was made to set the value to less than or equal to sourcebuffer.appendwindowstart, or nan.
... invalidstate
error this sourcebuffer object is being updated (i.e.
SourceBuffer.appendWindowStart - Web APIs
exception explanation invalidaccess
error an attempt was made to set the value to less than 0, or a value greater than or equal to sourcebuffer.appendwindowend.
... invalidstate
error this sourcebuffer object is being updated (i.e.
SourceBuffer.mode - Web APIs
exception explanation invalidaccess
error an attempt was made to set the value to segments when the initial value is sequence.
... invalidstate
error the sourcebuffer object is being updated (i.e.
SourceBuffer.remove() - Web APIs
exceptions exception explanation invalidaccess
error the mediasource.duration property is equal to nan, the start parameter is negative or greater than mediasource.duration, or the end parameter is less than or equal to start or equal to nan.
... invalidstate
error the sourcebuffer.updating property is equal to true, or this sourcebuffer has been removed from the mediasource.
SourceBuffer - Web APIs
sourcebuffer.on
error fired whenever an
error occurs during sourcebuffer.appendbuffer() or sourcebuffer.appendstream().
... codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.
error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystat...
SpeechSynthesisUtterance - Web APIs
error fired when an
error occurs that prevents the utterance from being succesfully spoken.
... also available via the on
error property mark fired when the spoken utterance reaches a named ssml "mark" tag.
SubtleCrypto.deriveKey() - Web APIs
exceptions the promise is rejected when one of the following exceptions are encountered: invalidaccess
error raised when the master key is not a key for the requested derivation algorithm or if the cryptokey.usages value of that key doesn't contain derivekey.
... syntax
error raised when keyusages is empty but the unwrapped key is of type secret or private.
SubtleCrypto.encrypt() - Web APIs
exceptions the promise is rejected when the following exceptions are encountered: invalidaccess
error raised when the requested operation is not valid for the provided key (e.g.
... operation
error raised when the operation failed for an operation-specific reason (e.g.
SubtleCrypto.exportKey() - Web APIs
exceptions the promise is rejected when one of the following exceptions is encountered: invalidaccess
error raised when trying to export a non-extractable key.
... type
error raised when trying to use an invalid format.
SubtleCrypto.generateKey() - Web APIs
exceptions the promise is rejected when the following exception is encountered: syntax
error raised when the result is a cryptokey of type secret or private but keyusages is empty.
... syntax
error raised when the result is a cryptokeypair and its privatekey.usages attribute is empty.
SubtleCrypto.importKey() - Web APIs
exceptions the promise is rejected when one of the following exceptions is encountered: syntax
error raised when keyusages is empty but the unwrapped key is of type secret or private.
... type
error raised when trying to use an invalid format or if the keydata is not suited for that format.
SubtleCrypto.wrapKey() - Web APIs
exceptions the promise is rejected when one of the following exceptions is encountered: invalidaccess
error raised when the wrapping key is not a key for the requested wrap algorithm.
... type
error raised when trying to use an invalid format.
Multi-touch interaction - Web APIs
the code does not include
error handling, or vertical moving.
... // this is a very basic 2-touch move/pinch/zoom handler that does not include //
error handling, only handles horizontal moves, etc.
TrackDefault.TrackDefault() - Web APIs
errors when this constructor is invoked, the following
errors can occur:
error explanation invalidaccess
error the supplied language is not a valid language code, e.g.
... type
error there are values specified in the kinds array that do not apply to the specified type.
USBEndpoint - Web APIs
data sent through a bulk endpoint is guaranteed to be delivered or generate an
error but may be preempted by other data traffic.
...data sent through an interrupt endpoint is guaranteed to be delivered or generate an
error and is also given dedicated bus time for transmission.
ValidityState.typeMismatch - Web APIs
the typemismatch is only one of the many possible
errors and is only relevant for the email and url types.
... when the value provided doesn't match the expected value based on the type for other input types, you get different
errors.
WebGL2RenderingContext.getBufferSubData() - Web APIs
exceptions an invalid_value
error is generated if: offset + returneddata.bytelength would extend beyond the end of the buffer returneddata is null offset is less than zero.
... an invalid_operation
error is generated if: zero is bound to target target is transform_feedback_buffer, and any transform feedback object is currently active.
WebGLContextEvent.statusMessage - Web APIs
this can occur, for example, if the webglcontextcreation
error event is fired.
... var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextcreation
error', function(e) { console.log('webgl context creation failed:' + e.statusmessage || 'unknown
error'); }, false); specifications specification status comment webgl 1.0the definition of 'webglcontextevent.statusmessage' in that specification.
WebGLRenderingContext.bindBuffer() - Web APIs
an attempt to bind the buffer to another target will throw an invalid_operation
error and the current buffer binding will remain the same.
...an attempt to do so will generate an invalid_operation
error, and the current binding will remain untouched.
WebGLRenderingContext.blendFunc() - Web APIs
exceptions if sfactor or dfactor is not one of the listed possible values, a gl.invalid_enum
error is thrown.
... if a constant color and a constant alpha value are used together as source and destination factors, a gl.invalid_enum
error is thrown.
WebGLRenderingContext.blendFuncSeparate() - Web APIs
exceptions if srcrgb, dstrgb, srcalpha, or dstalpha is not one of the listed possible values, a gl.invalid_enum
error is thrown.
... if a constant color and a constant alpha value are used together as source (srcrgb) and destination (dstrgb) factors, a gl.invalid_enum
error is thrown.
WebGLRenderingContext.bufferSubData() - Web APIs
exceptions a gl.invalid_value
error is thrown if the data would be written past the end of the buffer or if data is null.
... a gl.invalid_enum
error is thrown if target is not one of the allowed enums.
WebGLRenderingContext.getProgramInfoLog() - Web APIs
it contains
errors that occurred during failed linking or validation of webglprogram objects.
... examples checking program
errors var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); gl.getprograminfolog(program); specifications specification status comment webgl 1.0the definition of 'getprograminfolog' in that specification.
Boilerplate 1 - Web APIs
specifically, the html has a <p> element that contains some descriptive text about the page and may also hold
error messages; a <canvas> element; and optionally a <button>.
...in case of
error, it displays an
error message and returns null.
Taking still photos with WebRTC - Web APIs
byid('canvas'); photo = document.getelementbyid('photo'); startbutton = document.getelementbyid('startbutton'); get the media stream the next task is to get the media stream: navigator.mediadevices.getusermedia({ video: true, audio: false }) .then(function(stream) { video.srcobject = stream; video.play(); }) .catch(function(err) { console.log("an
error occurred: " + err); }); here, we're calling mediadevices.getusermedia() and requesting a video stream (without audio).
... the
error callback is called if opening the stream doesn't work.
Writing a WebSocket server in C# - Web APIs
console.writeline("{0}", text); } else console.writeline("mask bit not set"); console.writeline(); } } } } client.html <!doctype html> <style> textarea { vertical-align: bottom; } #output { overflow: auto; } #output > p { overflow-wrap: break-word; } #output span { color: blue; } #output span.
error { color: red; } </style> <h2>websocket test</h2> <textarea cols=60 rows=6></textarea> <button>send</button> <div id=output></div> <script> // http://www.websocket.org/echo.html var button = document.queryselector("button"), output = document.queryselector("#output"), textarea = document.queryselector("textarea"), // wsuri = "ws://echo.websocket.org/", wsur...
...cket(wsuri); button.addeventlistener("click", onclickbutton); websocket.onopen = function (e) { writetoscreen("connected"); dosend("websocket rocks"); }; websocket.onclose = function (e) { writetoscreen("disconnected"); }; websocket.onmessage = function (e) { writetoscreen("<span>response: " + e.data + "</span>"); }; websocket.on
error = function (e) { writetoscreen("<span class=
error>
error:</span> " + e.data); }; function dosend(message) { writetoscreen("sent: " + message); websocket.send(message); } function writetoscreen(message) { output.insertadjacenthtml("afterbegin", "<p>" + message + "</p>"); } function onclickbutton() { var text = textarea.value; ...
Using bounded reference spaces - Web APIs
choice, like this: let xrsession = null; let xrreferencespace = null; let spacetype = null; function onsessionstarted(session) { xrsession = session; spacetype = "bounded-floor"; xrsession.requestreferencespace(spacetype) .then(onrefspacecreated) .catch(() => { spacetype = "local-floor"; xrsession.requestreferencespace(spacetype) .then(onrefspacecreated) .catch(handle
error); }); } function onrefspacecreated(refspace) { xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl) }); // now set up matrices, create a secondary reference space to // transform the viewer's pose, and so forth.
...if neither type of space can be created, an
error handler is called (handle
error()).
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
function myanimationframecallback(time, frame) { let adjustedrefspace = applypositionoffsets(xrreferencespace); let pose = frame.getviewerpose(adjustedrefspace); animationframerequestid = frame.session.requestanimationframe(myanimationframecallback); if (pose) { let gllayer = frame.session.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); checkgl
error("binding the framebuffer"); gl.clearcolor(0, 0, 0, 1.0); gl.cleardepth(1.0); gl.clear(gl.color_buffer_bit | gl.depth_buffer_bit); checkgl
error("clearing the framebuffer"); const deltatime = (time - lastframetime) * 0.001; lastframetime = time; for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, vie...
...wport.width, viewport.height); checkgl
error(`setting viewport for eye: ${view.eye}`); myrenderscene(gl, view, scenedata, deltatime); } } } the callback begins by calling a custom function, applypositionoffsets(), which takes a reference space and applies to its transform matrix any changes that need to be made to take into account things such as user inputs from devices not controlled by webxr, such as the keyboard and mouse.
Using the Web Speech API - Web APIs
we also use a speechrecognition.onspeechend handler to stop the speech recognition service from running (using speechrecognition.stop()) once a single word has been recognised and it has finished being spoken: recognition.onspeechend = function() { recognition.stop(); } handling
errors and unrecognised speech the last two handlers are there to handle cases where speech was recognised that wasn't in the defined grammar, or an
error occured.
... speechrecognition.onnomatch seems to be supposed to handle the first case mentioned, although note that at the moment it doesn't seem to fire correctly; it just returns whatever was recognised anyway: recognition.onnomatch = function(event) { diagnostic.textcontent = 'i didnt recognise that color.'; } speechrecognition.on
error handles cases where there is an actual
error with the recognition successfully — the speechrecognition
error.
error property contains the actual
error returned: recognition.on
error = function(event) { diagnostic.textcontent = '
error occurred in recognition: ' + event.
error; } speech synthesis speech synthesis (aka text-to-speech, or tts) involves receiving synthesising text contained within an app to speech, and playing it out of a device's speaker or audio outp...
Web Speech API - Web APIs
speechrecognition
error represents
error messages from the recognition service.
... speechsynthesis
errorevent contains information about any
errors that occur while processing speechsynthesisutterance objects in the speech service.
Using the Web Storage API - Web APIs
conversely, we might get a legitimate quotaexceeded
error, which means that we've used up all available storage space, but storage is actually available.
...m(x, x); storage.removeitem(x); return true; } catch(e) { return e instanceof domexception && ( // everything except firefox e.code === 22 || // firefox e.code === 1014 || // test name field too, because code might not be present // everything except firefox e.name === 'quotaexceeded
error' || // firefox e.name === 'ns_
error_dom_quota_reached') && // acknowledge quotaexceeded
error only if there's something already stored (storage && storage.length !== 0); } } and here is how you would use it: if (storageavailable('localstorage')) { // yippee!
window.dump() - Web APIs
privileged code can also use components.utils.report
error and nsiconsoleservice to log messages to the
error console/browser console.
... in gecko dump() is disabled by default – it doesn't do anything but doesn't raise an
error either.
Window.getComputedStyle() - Web APIs
throws type
error if the passed object is not an element or the pseudoelt is not a valid pseudo-element selector or is ::part() or ::slotted().
...non-elements, like a text node, will throw an
error.
WindowOrWorkerGlobalScope.btoa() - Web APIs
exceptions invalidcharacter
error the string contained a character that did not fit in a single byte.
...so if you pass a string into btoa() containing characters that occupy more than one byte, you will get an
error, because this is not considered binary data: const ok = "a"; console.log(ok.codepointat(0).tostring(16)); // 61: occupies < 1 byte const notok = "✓" console.log(notok.codepointat(0).tostring(16)); // 2713: occupies > 1 byte console.log(btoa(ok)); // yq== console.log(btoa(notok)); //
error if you need to encode unicode text as ascii using btoa(), one option is to convert the string such...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
od(1); // prints "one" settimeout(myarray.mymethod, 1000); // prints "[object window]" after 1 second settimeout(myarray.mymethod, 1500, "1"); // prints "undefined" after 1,5 seconds // passing the 'this' object with .call won't work // because this will change the value of this inside settimeout itself // while we want to change the value of this inside myarray.mymethod // in fact, it will be an
error because settimeout code expects this to be the window object: settimeout.call(myarray, myarray.mymethod, 2000); //
error: "ns_
error_xpc_bad_op_on_wn_proto: illegal operation on wrappednative prototype object" settimeout.call(myarray, myarray.mymethod, 2500, 2); // same
error as you can see there are no ways to pass the this object to the callback function in the legacy javascript.
...|*| http://www.gnu.org/licenses/lgpl-3.0.html |*| \*/ function minidaemon (oowner, ftask, nrate, nlen) { if (!(this && this instanceof minidaemon)) { return; } if (arguments.length < 2) { throw new type
error('minidaemon - not enough arguments'); } if (oowner) { this.owner = oowner; } this.task = ftask; if (isfinite(nrate) && nrate > 0) { this.rate = math.floor(nrate); } if (nlen > 0) { this.length = math.floor(nlen); } } minidaemon.prototype.owner = null; minidaemon.prototype.task = null; minidaemon.prototype.rate = 100; minidaemon.prototype.length = infinity; /* these properties should b...
WorkerGlobalScope - Web APIs
(this does not yet appear to be implemented in any browser.) events
error fired when an
error occured.
... also available via the workerglobalscope.on
error property.
WritableStream.abort() - Web APIs
the abort() method of the writablestream interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an
error state, with any queued writes discarded.
... exceptions type
error the stream you are trying to abort is not a writablestream, or it is locked.
WritableStreamDefaultController - Web APIs
methods writablestreamdefaultcontroller.
error() causes any future interactions with the associated stream to
error.
... examples const writablestream = new writablestream({ start(controller) { // do stuff with controller //
error stream if necessary controller.
error('my stream is broken'); }, write(chunk, controller) { ...
WritableStreamDefaultWriter.abort() - Web APIs
the abort() method of the writablestreamdefaultwriter interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an
error state, with any queued writes discarded.
... exceptions type
error the stream you are trying to abort is not a writablestream, or it is locked.
WritableStreamDefaultWriter.desiredSize - Web APIs
the value will be null if the stream cannot be successfully written to (due to either being
errored, or having an abort queued up), and zero if the stream is closed.
... exceptions type
error the writer’s lock is released.
WritableStreamDefaultWriter.ready - Web APIs
defaultwriter.ready .then(function() { defaultwriter.write(chunk) .then(function() { console.log("chunk written to sink.); }) .catch(function(err) { console.log("chunk
error: " + err); }); }); // call ready again to ensure that all chunks are written // before closing the writer.
... defaultwriter.ready .then(function() { defaultwriter.close() .then(function() { console.log("all chunks written"); }) .catch(function(err) { console.log("stream
error: " + err); }); }); }); } specifications specification status comment streamsthe definition of 'ready' in that specification.
XMLHttpRequest.responseText - Web APIs
exceptions invalidstate
error the xmlhttprequest.responsetype is not set to either the empty string or "text".
... since the responsetext property is only valid for text content, any other value is an
error condition.
XMLHttpRequest.send() - Web APIs
exceptions exception description invalidstate
error send() has already been invoked for the request, and/or the request is complete.
... network
error the resource type to be fetched is a blob, and the method is not get.
XMLHttpRequest.upload - Web APIs
error on
error the upload failed due to an
error.
...prior to this event, one of load,
error, abort, or timeout will already have been delivered to indicate why the upload ended.
XPathException.code - Web APIs
the code read-only property of the xpathexception interface returns a short that contains one of the
error code constants.
... syntax var exceptioncode = exception.code; value a short number representing the
error code.
XPathException - Web APIs
properties xpathexception.code read only returns a short that contains one of the
error code constants.
... constants constant value description invalid_expression_err 51 if the expression has a syntax
error or otherwise is not a legal expression according to the rules of the specific xpathevaluator or contains specialized extension functions or variables not supported by this implementation.
XRPermissionDescriptor - Web APIs
if the permission request promise is rejected, the
error is handled (currently by just dumping it to the console using domxref("console.log()")}}).
... if the permissions api isn't available at all, this example simply assumes that webxr will report an appropriate
error if permission isn't available, and tries to start up the webxr session using the same setupxr() function called by the granted case.
XRWebGLLayer() - Web APIs
exceptions invalidstate
error the new xrwebgllayer could not be created due to one of a number of possible state
errors: the xrsession specified by session has already been stopped.
... operation
error the resources (including memory buffers) needed for the layer to operate could not be allocated.
ARIA live regions - Accessibility
here is a screenshot of voiceover on mac announcing the update (via subtitles) to the live region: preferring specialized live region roles in the following well-known predefined cases it is better to use a specific provided "live region role": role description compatibility notes log chat,
error, game or other type of log to maximize compatibility, add a redundant aria-live="polite" when using this role.
... alert
error or warning message that flashes on the screen.
Using ARIA: Roles, states, and properties - Accessibility
esentation row rowgroup rowheader separator table term textbox toolbar tooltip landmark roles banner complementary contentinfo form main navigation region search live region roles alert log marquee status timer window roles alertdialog dialog states and properties widget attributes aria-autocomplete aria-checked aria-current aria-disabled aria-
errormessage aria-expanded aria-haspopup aria-hidden aria-invalid aria-label aria-level aria-modal aria-multiline aria-multiselectable aria-orientation aria-placeholder aria-pressed aria-readonly aria-required aria-selected aria-sort aria-valuemax aria-valuemin aria-valuenow aria-valuetext live region attributes aria-live aria-relevant aria-atomic aria-busy drag & drop ...
...attributes aria-dropeffect aria-dragged relationship attributes aria-activedescendant aria-colcount aria-colindex aria-colspan aria-controls aria-describedby aria-details aria-
errormessage aria-flowto aria-labelledby aria-owns aria-posinset aria-rowcount aria-rowindex aria-rowspan aria-setsize microsoftedge-specific properties x-ms-aria-flowfrom ...
Accessibility documentation index - Accessibility
8 forms aria, accessibility the following pages provide various techniques for improving the accessibility of web forms: 9 alerts aria, accessibility, forms, web you have a form — a contact form, for example — that you want to put some accessible
error checking into.
... 103 understandable accessibility, help, language, navigation, principle 3, text, understandable, wcag, web content accessibility guidelines, abbreviations, consistency,
error messages, form validation, labels, slang this article provides practical advice on how to write your web content so that it conforms to the success criteria outlined in the understandable principle of the web content accessibility guidelines (wcag) 2.0 and 2.1.
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
if you had written color: 16px without any variable substitutes, then it was a syntax
error.
... note: while a syntax
error in a css property / value pair will lead to the line being ignored, using a cascaded value, invalid substitution -- using a custom property value that is invalid -- is not ignored, leading to the value to be inherited.
Introduction to HTML5 - Developer guides
until the introduction of html5, only the meaning of valid mark-up was defined, meaning that as soon as one small
error was made in the mark-up (most websites have at least one), the behavior was undefined.
...now, faced with
errors in the mark-up, all compliant browsers must behave exactly in the same way.
Using HTML sections and outlines - Developer guides
</script> <![endif]--> <noscript> <p><strong>this web page requires javascript to be enabled.</strong></p> <p>javascript is an object-oriented computer programming language commonly used to create interactive effects within web browsers.</p> <p><a href="https://goo.gl/koeeaj">how to enable javascript?</a></p> </noscript> note: this code will also cause the html validator to return
errors.
... this isn't a really bad thing neccessarily — sites will often have a few validation
errors — but it's something to be aware of still.
Parsing and serializing XML - Developer guides
parsing strings into dom trees this example converts an xml fragment in a string into a dom tree using a domparser: var smystring = '<a id="a"><b id="b">hey!</b></a>'; var oparser = new domparser(); var odom = oparser.parsefromstring(smystring, "application/xml"); // print the name of the root element or
error message console.log(odom.documentelement.nodename == "parser
error" ?
... "
error while parsing" : odom.documentelement.nodename); parsing url-addressable resources into dom trees using xmlhttprequest here is sample code that reads and parses a url-addressable xml file into a dom tree: var xhr = new xmlhttprequest(); xhr.onload = function() { dump(xhr.responsexml.documentelement.nodename); } xhr.on
error = function() { dump("
error while getting xml."); } xhr.open("get", "example.xml"); xhr.responsetype = "document"; xhr.send(); the value returned in the xhr object's responsexml field is a document constructed by parsing the xml.
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
calling any of the following on a tainted canvas will result in an
error: calling getimagedata() on the canvas's context calling toblob() on the <canvas> element itself calling todataurl() on the canvas attempting any of these when the canvas is tainted will cause a security
error to be thrown.
...d: function imagereceived() { let canvas = document.createelement("canvas"); let context = canvas.getcontext("2d"); canvas.width = downloadedimg.width; canvas.height = downloadedimg.height; context.drawimage(downloadedimg, 0, 0); imagebox.appendchild(canvas); try { localstorage.setitem("saved-image-example", canvas.todataurl("image/png")); } catch(err) { console.log("
error: " + err); } } imagereceived() is called to handle the "load" event on the htmlimageelement that receives the downloaded image.
<img>: The Image Embed element - HTML: Hypertext Markup Language
alt text is also displayed on the page if the image can't be loaded for some reason: for example, network
errors, content blocking, or linkrot.
... image loading
errors if an
error occurs while loading or rendering an image, and an on
error event handler has been set on the
error event, that event handler will get called.
<input type="text"> - HTML: Hypertext Markup Language
/button> </div> </form> div { margin-bottom: 10px; position: relative; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } this renders like so: if you try to submit the form with no search term entered into it, the browser will show an
error message.
...t</button> </div> </form> div { margin-bottom: 10px; position: relative; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } this renders like so: if you try to submit the form with less than 4 characters, you'll be given an appropriate
error message (which differs between browsers).
<input type="week"> - HTML: Hypertext Markup Language
as a result, supporting browsers will display an
error if you try to submit an empty week field.
...ks, and also made the field required: <form> <div> <label for="week">what week would you like to start?</label> <input id="week" type="week" name="week" min="2017-w01" max="2017-w52" required> <span class="validity"></span> </div> <div> <input type="submit" value="submit form"> </div> </form> if you try to submit the form with no value, the browser displays an
error.
Browser detection using the user agent - HTTP
it will cause a syntax
error in // browsers that do not support look-behind expressions // because all browsers parse the entire script, including // sections of the code that are never executed.
.../reg/igm) will cause a parser
error in unsupported browsers.
Cache-Control - HTTP
cache-control: immutable cache-control: stale-while-revalidate=<seconds> cache-control: stale-if-
error=<seconds> directives cacheability a response is normally cached by the browser if: it has a status code of 301, 302, 307, 308, or 410 and cache-control does not have no-store, or if proxy, does not have private and authorization is unset either has a status code of 301, 302, 307, 308, or 410 or has public, max-age or s-maxage in cache-control or has expires set publ...
... stale-if-
error=<seconds> indicates the client will accept a stale response if the check for a fresh one fails.
Want-Digest - HTTP
if want-digest does not include any digest algorithms that the server supports, the server may respond with: a digest calculated using a different digest algorithm, or a 400 bad request
error, and include another want-digest header with that response, listing the algorithms that it does support.
...56=x48e9qookqqrvdts8nojrjn3owduoywxbf7kbu9dbpe= unsupported digests the server does not support any of the requested digest algorithms, so uses a different algorithm: request: get /item want-digest: sha;q=1 response: http/1.1 200 ok digest: sha-256=x48e9qookqqrvdts8nojrjn3owduoywxbf7kbu9dbpe= the server does not support any of the requested digest algorithms, so responds with a 400
error and includes another want-digest header, listing the algorithms that it does support: request: get /item want-digest: sha;q=1 response: http/1.1 400 bad request want-digest: sha-256, sha-512 specifications specification title draft-ietf-httpbis-digest-headers-latest resource digests for http this header was originally defined in rfc 3230, ...
HTTP headers - HTTP
nel defines a mechanism that enables developers to declare a network
error reporting policy.
... report-to used to specify a server endpoint for the browser to send warning and
error reports to.
A typical HTTP session - HTTP
-8 content-length: 38217 connection: keep-alive cache-control: no-cache, no-store, must-revalidate, max-age=0 content-language: en-us date: thu, 06 dec 2018 17:35:13 gmt expires: thu, 06 dec 2018 17:35:13 gmt server: meinheld/0.6.1 strict-transport-security: max-age=63072000 x-content-type-options: nosniff x-frame-options: deny x-xss-protection: 1; mode=block vary: accept-encoding,cookie x-cache:
error from cloudfront <!doctype html...
...responses are grouped into five classes: informational responses, successful responses, redirects, client
errors, and servers
errors.
416 Range Not Satisfiable - HTTP
the hypertext transfer protocol (http) 416 range not satisfiable
error response code indicates that a server cannot serve the requested ranges.
...content-range: bytes */12777 faced with this
error, browsers usually either abort the operation (for example, a download will be considered as non-resumable) or ask for the whole document again.
418 I'm a teapot - HTTP
the http 418 i'm a teapot client
error response code indicates that the server refuses to brew coffee because it is, permanently, a teapot.
...this
error is a reference to hyper text coffee pot control protocol defined in april fools' jokes in 1998 and 2014.
501 Not Implemented - HTTP
the hypertext transfer protocol (http) 501 not implemented server
error response code means that the server does not support the functionality required to fulfill the request.
... a 501
error is not something you can fix, but requires a fix by the web server you are trying to access.
502 Bad Gateway - HTTP
the hypertext transfer protocol (http) 502 bad gateway server
error response code indicates that the server, while acting as a gateway or proxy, received an invalid response from the upstream server.
... note: a gateway might refer to different things in networking and a 502
error is usually not something you can fix, but requires a fix by the web server or the proxies you are trying to get access through.
504 Gateway Timeout - HTTP
the hypertext transfer protocol (http) 504 gateway timeout server
error response code indicates that the server, while acting as a gateway or proxy, did not get a response in time from the upstream server that it needed in order to complete the request.
... note: a gateway might refer to different things in networking and a 504
error is usually not something you can fix, but requires a fix by the web server or the proxies you are trying to get access through.
Numbers and dates - JavaScript
if the digits after the 0b are not 0 or 1, the following syntax
error is thrown: "missing binary digits after 0b".
...if the digits after 0x are outside the range (0123456789abcdef), the following syntax
error is thrown: "identifier starts immediately after numeric literal".
JavaScript Guide - JavaScript
chapters this guide is divided into several chapters: introduction about this guide about javascript javascript and java ecmascript tools hello world grammar and types basic syntax & comments declarations variable scope variable hoisting data structures and types literals control flow and
error handling if...else switch try/catch/throw
error objects loops and iteration for while do...while break/continue for..in for..of functions defining functions calling functions function scope closures arguments & parameters arrow functions expressions and operators assignment & comparisons arithmetic operators bitwise & logical opera...
...nationalization regular expressions indexed collections arrays typed arrays keyed collections map weakmap set weakset working with objects objects and properties creating objects defining methods getter and setter details of the object model prototype-based oop creating object hierarchies inheritance promises guarantees chaining
error propagation composition timing iterators and generators iterators iterables generators meta programming proxy handlers and traps revocable proxy reflect javascript modules exporting importing default exports renaming features aggregating modules dynamic module loading next » ...
Default parameters - JavaScript
this means that functions and variables declared in the function body cannot be referred to from default value parameter initializers; attempting to do so throws a run-time reference
error.
... the following function will throw a reference
error when invoked, because the default parameter value does not have access to the child scope of the function body: function f(a = go()) { // throws a `reference
error` when `f` is invoked.
Rest parameters - JavaScript
y the arguments // before rest parameters, "arguments" could be converted to a normal array using: function f(a, b) { let normalarray = array.prototype.slice.call(arguments) // -- or -- let normalarray = [].slice.call(arguments) // -- or -- let normalarray = array.from(arguments) let first = normalarray.shift() // ok, gives the first argument let first = arguments.shift() //
error (arguments is not a normal array) } // now, you can easily gain access to a normal array using a rest parameter function f(...args) { let normalarray = args let first = normalarray.shift() // ok, gives the first argument } examples using rest parameters in this example, the first argument is mapped to a and the second to b, so these named arguments are used as normal.
...ect array methods can be used on rest parameters, but not on the arguments object: function sortrestargs(...theargs) { let sortedargs = theargs.sort() return sortedargs } console.log(sortrestargs(5, 3, 7, 1)) // 1, 3, 5, 7 function sortarguments() { let sortedargs = arguments.sort() return sortedargs // this will never happen } console.log(sortarguments(5, 3, 7, 1)) // throws a type
error (arguments.sort is not a function) to use array methods on the arguments object, it must be converted to a real array first.
Array.prototype.lastIndexOf() - JavaScript
this algorithm is exactly the one specified in ecma-262, 5th edition, assuming object, type
error, number, math.floor, math.abs, and math.min have their original values.
... // production steps of ecma-262, edition 5, 15.4.4.15 // reference: http://es5.github.io/#x15.4.4.15 if (!array.prototype.lastindexof) { array.prototype.lastindexof = function(searchelement /*, fromindex*/) { 'use strict'; if (this === void 0 || this === null) { throw new type
error(); } var n, k, t = object(this), len = t.length >>> 0; if (len === 0) { return -1; } n = len - 1; if (arguments.length > 1) { n = number(arguments[1]); if (n != n) { n = 0; } else if (n != 0 && n != (1 / 0) && n != -(1 / 0)) { n = (n > 0 || -1) * math.floor(math.abs(n)); } } for (k = n >= 0 ?
Array.prototype.some() - JavaScript
this algorithm is exactly the one specified in ecma-262, 5th edition, assuming object and type
error have their original values and that fun.call evaluates to the original value of function.prototype.call().
... // production steps of ecma-262, edition 5, 15.4.4.17 // reference: http://es5.github.io/#x15.4.4.17 if (!array.prototype.some) { array.prototype.some = function(fun, thisarg) { 'use strict'; if (this == null) { throw new type
error('array.prototype.some called on null or undefined'); } if (typeof fun !== 'function') { throw new type
error(); } var t = object(this); var len = t.length >>> 0; for (var i = 0; i < len; i++) { if (i in t && fun.call(thisarg, t[i], i, t)) { return true; } } return false; }; } examples testing value of array elements the following example tests whether any element in the array is bigger than 10.
Array - JavaScript
nevertheless, trying to access an element of an array as follows throws a syntax
error because the property name is not valid: console.log(arr.0) // a syntax
error there is nothing special about javascript arrays and the properties that cause this.
... let years = [1950, 1960, 1970, 1980, 1990, 2000, 2010] console.log(years.0) // a syntax
error console.log(years[0]) // works properly renderer.3d.settexture(model, 'character.png') // a syntax
error renderer['3d'].settexture(model, 'character.png') // works properly in the 3d example, '3d' had to be quoted (because it begins with a digit).
Atomics.add() - JavaScript
exceptions throws a type
error, if typedarray is not one of the allowed integer types.
... throws a range
error, if index is out of bounds in the typedarray.
Atomics.and() - JavaScript
exceptions throws a type
error, if typedarray is not one of the allowed integer types.
... throws a range
error, if index is out of bounds in the typedarray.
Atomics.compareExchange() - JavaScript
exceptions throws a type
error, if typedarray is not one of the allowed integer types.
... throws a range
error, if index is out of bounds in the typedarray.
Atomics.exchange() - JavaScript
exceptions throws a type
error, if typedarray is not one of the allowed integer types.
... throws a range
error, if index is out of bounds in the typedarray.
Atomics.load() - JavaScript
exceptions throws a type
error, if typedarray is not one of the allowed integer types.
... throws a range
error, if index is out of bounds in the typedarray.
Atomics.notify() - JavaScript
exceptions throws a type
error, if typedarray is not a int32array.
... throws a range
error, if index is out of bounds in the typedarray.
Atomics.or() - JavaScript
exceptions throws a type
error, if typedarray is not one of the allowed integer types.
... throws a range
error, if index is out of bounds in the typedarray.
Atomics.store() - JavaScript
exceptions throws a type
error, if typedarray is not one of the allowed integer types.
... throws a range
error, if index is out of bounds in the typedarray.
Atomics.sub() - JavaScript
exceptions throws a type
error, if typedarray is not one of the allowed integer types.
... throws a range
error, if index is out of bounds in the typedarray.
Atomics.wait() - JavaScript
exceptions throws a type
error, if typedarray is not a shared int32array.
... throws a range
error, if index is out of bounds in the typedarray.
Atomics.xor() - JavaScript
exceptions throws a type
error, if typedarray is not one of the allowed integer types.
... throws a range
error, if index is out of bounds in the typedarray.
BigInt - JavaScript
1n < 2 // ↪ true 2n > 1 // ↪ true 2 > 2 // ↪ false 2n > 2 // ↪ false 2n >= 2 // ↪ true they may be mixed in arrays and sorted: const mixed = [4n, 6, -12n, 10, 4, 0, 0n] // ↪ [4n, 6, -12n, 10, 4, 0, 0n] mixed.sort() // default sorting behavior // ↪ [ -12n, 0, 0n, 10, 4n, 4, 6 ] mixed.sort((a, b) => a - b) // won't work since subtraction will not work with mixed types // type
error: can't convert bigint to number // sort with an appropriate numeric comparator mixed.sort((a, b) => (a < b) ?
... use within json using json.stringify() with any bigint value will raise a type
error as bigint values aren't serialized in json by default.
DataView() constructor - JavaScript
exceptions range
error thrown if the byteoffset or bytelength parameter values result in the view extending past the end of the buffer.
... for example, if the buffer is 16 bytes long, the byteoffset is 8, and the bytelength is 10, this
error is thrown because the resulting view tries to extend 2 bytes past the total length of the buffer.
FinalizationRegistry.prototype.unregister() - JavaScript
examples using unregister this example shows registering a target object using that same object as the unregister token, then later unregistering it via unregister: class thingy { #cleanup = label => { // ^^^^^−−−−− held value console.
error( `the \`release\` method was never called for the object with the label "${label}"` ); }; #registry = new finalizationregistry(this.#cleanup); /** * constructs a `thingy` instance.
... */ release() { this.#registry.unregister(this); // ^^^^−−−−− unregister token } } this example shows registering a target object using a different object as its unregister token: { // ^^^^−−−−− held value console.
error( `the \`release\` method was never called for the \`thingy\` for the file "${file.name}"` ); }; #registry = new finalizationregistry(this.#cleanup); /** * constructs a `thingy` instance for the given file.
Function.prototype.toString() - JavaScript
the tostring() method will throw a type
error exception ("function.prototype.tostring called on incompatible object"), if its this value object is not a function object.
... function.prototype.tostring.call('foo'); // type
error if the tostring() method is called on built-in function objects or a function created by function.prototype.bind, tostring() returns a native function string which looks like "function () {\n [native code]\n}" if the tostring() method is called on a function created by the function constructor, tostring() returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body.
Object.defineProperties() - JavaScript
return typeof v === 'function'; } if (typeof desc !== 'object' || desc === null) throw new type
error('bad desc'); var d = {}; if (hasproperty(desc, 'enumerable')) d.enumerable = !!desc.enumerable; if (hasproperty(desc, 'configurable')) d.configurable = !!desc.configurable; if (hasproperty(desc, 'value')) d.value = desc.value; if (hasproperty(desc, 'writable')) d.writable = !!desc.writable; if (hasproperty(desc, 'get')) { var g = desc.get; ...
... if (!iscallable(g) && typeof g !== 'undefined') throw new type
error('bad get'); d.get = g; } if (hasproperty(desc, 'set')) { var s = desc.set; if (!iscallable(s) && typeof s !== 'undefined') throw new type
error('bad set'); d.set = s; } if (('get' in d || 'set' in d) && ('value' in d || 'writable' in d)) throw new type
error('identity-confused descriptor'); return d; } if (typeof obj !== 'object' || obj === null) throw new type
error('bad obj'); properties = object(properties); var keys = object.keys(properties); var descs = []; for (var i = 0; i < keys.length; i++) descs.push([keys[i], converttodescriptor(properties[keys[i]])]); for (var i = 0; i < descs.length; i++) object.defineproperty(obj,...
Object.getOwnPropertyDescriptor() - JavaScript
table: true // } o = {}; object.defineproperty(o, 'qux', { value: 8675309, writable: false, enumerable: false }); d = object.getownpropertydescriptor(o, 'qux'); // d is { // value: 8675309, // writable: false, // enumerable: false, // configurable: false // } non-object coercion in es5, if the first argument to this method is not an object (a primitive), then it will cause a type
error.
... object.getownpropertydescriptor('foo', 0); // type
error: "foo" is not an object // es5 code object.getownpropertydescriptor('foo', 0); // object returned by es2015 code: { // configurable: false, // enumerable: true, // value: "f", // writable: false // } specifications specification ecmascript (ecma-262)the definition of 'object.getownpropertydescriptor' in that specification.
Object.getOwnPropertyNames() - JavaScript
in es5, if the argument to this method is not an object (a primitive), then it will cause a type
error.
... object.getownpropertynames('foo'); // type
error: "foo" is not an object (es5 code) object.getownpropertynames('foo'); // ["0", "1", "2", "length"] (es2015 code) examples using object.getownpropertynames() var arr = ['a', 'b', 'c']; console.log(object.getownpropertynames(arr).sort()); // .sort() is an array method.
Object.getPrototypeOf() - JavaScript
examples using getprototypeof var proto = {}; var obj = object.create(proto); object.getprototypeof(obj) === proto; // true non-object coercion in es5, it will throw a type
error exception if the obj parameter isn't an object.
... object.getprototypeof('foo'); // type
error: "foo" is not an object (es5 code) object.getprototypeof('foo'); // string.prototype (es2015 code) specifications specification ecmascript (ecma-262)the definition of 'object.getprototypeof' in that specification.
Object.isExtensible() - JavaScript
var frozen = object.freeze({}); object.isextensible(frozen); // === false non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a type
error.
... object.isextensible(1); // type
error: 1 is not an object (es5 code) object.isextensible(1); // false (es2015 code) specifications specification ecmascript (ecma-262)the definition of 'object.isextensible' in that specification.
Object.isFrozen() - JavaScript
object.issealed(frozen); // === true non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a type
error.
... object.isfrozen(1); // type
error: 1 is not an object (es5 code) object.isfrozen(1); // true (es2015 code) specifications specification ecmascript (ecma-262)the definition of 'object.isfrozen' in that specification.
Object.isSealed() - JavaScript
== true // (all properties also non-writable) var s2 = object.seal({ p: 3 }); object.isfrozen(s2); // === false // ('p' is still writable) var s3 = object.seal({ get p() { return 0; } }); object.isfrozen(s3); // === true // (only configurability matters for accessor properties) non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a type
error.
... object.issealed(1); // type
error: 1 is not an object (es5 code) object.issealed(1); // true (es2015 code) specifications specification ecmascript (ecma-262)the definition of 'object.issealed' in that specification.
Object.setPrototypeOf() - JavaScript
description throws a type
error exception if the object whose [[prototype]] is to be modified is non-extensible according to object.isextensible().
...* **/ object.appendchain = function(ochain, oproto) { if (arguments.length < 2) { throw new type
error('object.appendchain - not enough arguments'); } if (typeof oproto !== 'object' && typeof oproto !== 'string') { throw new type
error('second argument to object.appendchain must be an object or a string'); } var onewproto = oproto, oreturn = o2nd = olast = ochain instanceof this ?
Promise.race() - JavaScript
}); var p2 = new promise(function(resolve, reject) { settimeout(() => resolve('two'), 100); }); promise.race([p1, p2]) .then(function(value) { console.log(value); // "two" // both fulfill, but p2 is faster }); var p3 = new promise(function(resolve, reject) { settimeout(() => resolve('three'), 100); }); var p4 = new promise(function(resolve, reject) { settimeout(() => reject(new
error('four')), 500); }); promise.race([p3, p4]) .then(function(value) { console.log(value); // "three" // p3 is faster, so it fulfills }, function(reason) { // not called }); var p5 = new promise(function(resolve, reject) { settimeout(() => resolve('five'), 500); }); var p6 = new promise(function(resolve, reject) { settimeout(() => reject(new
error('six')), 100); }); promise.race([p5,...
... p6]) .then(function(value) { // not called }, function(
error) { console.log(
error.message); // "six" // p6 is faster, so it rejects }); specifications specification ecmascript (ecma-262)the definition of 'promise.race' in that specification.
Promise.reject() - JavaScript
for debugging purposes and selective
error catching, it is useful to make reason an instanceof
error.
... examples using the static promise.reject() method promise.reject(new
error('fail')).then(function() { // not called }, function(
error) { console.
error(
error); // stacktrace }); specifications specification ecmascript (ecma-262)the definition of 'promise.reject' in that specification.
Promise.resolve() - JavaScript
resolving thenables and throwing
errors // resolving a thenable object var p1 = promise.resolve({ then: function(onfulfill, onreject) { onfulfill('fulfilled!'); } }); console.log(p1 instanceof promise) // true, object casted to a promise p1.then(function(v) { console.log(v); // "fulfilled!" }, function(e) { // not called }); // thenable throws before callback // promise rejects var thenable = { then: function(resolve) {...
... throw new type
error('throwing'); resolve('resolving'); }}; var p2 = promise.resolve(thenable); p2.then(function(v) { // not called }, function(e) { console.
error(e); // type
error: throwing }); // thenable throws after callback // promise resolves var thenable = { then: function(resolve) { resolve('resolving'); throw new type
error('throwing'); }}; var p3 = promise.resolve(thenable); p3.then(function(v) { console.log(v); // "resolving" }, function(e) { // not called }); specifications specification ecmascript (ecma-262)the definition of 'promise.resolve' in that specification.
handler.defineProperty() - JavaScript
interceptions this trap can intercept these operations: object.defineproperty() reflect.defineproperty() invariants if the following invariants are violated, the proxy will throw a type
error: a property cannot be added, if the target object is not extensible.
... in strict mode, a false return value from the defineproperty() handler will throw a type
error exception.
handler.get() - JavaScript
interceptions this trap can intercept these operations: property access: proxy[foo]and proxy.bar inherited property access: object.create(proxy)[foo] reflect.get() invariants if the following invariants are violated, the proxy will throw a type
error: the value reported for a property must be the same as the value of the corresponding target object property if the target object property is a non-writable, non-configurable own data property.
... const obj = {}; object.defineproperty(obj, 'a', { configurable: false, enumerable: false, value: 10, writable: false }); const p = new proxy(obj, { get: function(target, property) { return 20; } }); p.a; // type
error is thrown specifications specification ecmascript (ecma-262)the definition of '[[get]]' in that specification.
handler.getOwnPropertyDescriptor() - JavaScript
interceptions this trap can intercept these operations: object.getownpropertydescriptor() reflect.getownpropertydescriptor() invariants if the following invariants are violated, the proxy will throw a type
error: getownpropertydescriptor() must return an object or undefined.
... const obj = { a: 10 }; object.preventextensions(obj); const p = new proxy(obj, { getownpropertydescriptor: function(target, prop) { return undefined; } }); object.getownpropertydescriptor(p, 'a'); // type
error is thrown specifications specification ecmascript (ecma-262)the definition of '[[getownproperty]]' in that specification.
handler.getPrototypeOf() - JavaScript
description interceptions this trap can intercept these operations: object.getprototypeof() reflect.getprototypeof() __proto__ object.prototype.isprototypeof() instanceof invariants if the following invariants are violated, the proxy will throw a type
error: getprototypeof() method must return an object or null.
... reflect.getprototypeof(p) === array.prototype, // true p.__proto__ === array.prototype, // true array.prototype.isprototypeof(p), // true p instanceof array // true ); two kinds of exceptions const obj = {}; const p = new proxy(obj, { getprototypeof(target) { return 'foo'; } }); object.getprototypeof(p); // type
error: "foo" is not an object or null const obj = object.preventextensions({}); const p = new proxy(obj, { getprototypeof(target) { return {}; } }); object.getprototypeof(p); // type
error: expected same prototype value specifications specification ecmascript (ecma-262)the definition of '[[getprototypeof]]' in that specification.
handler.has() - JavaScript
interceptions this trap can intercept these operations: property query: foo in proxy inherited property query: foo in object.create(proxy) with check: with(proxy) { (foo); } reflect.has() invariants if the following invariants are violated, the proxy will throw a type
error: a property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object.
... const obj = { a: 10 }; object.preventextensions(obj); const p = new proxy(obj, { has: function(target, prop) { return false; } }); 'a' in p; // type
error is thrown specifications specification ecmascript (ecma-262)the definition of '[[hasproperty]]' in that specification.
handler.isExtensible() - JavaScript
interceptions this trap can intercept these operations: object.isextensible() reflect.isextensible() invariants if the following invariants are violated, the proxy will throw a type
error: object.isextensible(proxy) must return the same value as object.isextensible(target).
... const p = new proxy({}, { isextensible: function(target) { return false; } }); object.isextensible(p); // type
error is thrown specifications specification ecmascript (ecma-262)the definition of '[[isextensible]]' in that specification.
handler.ownKeys() - JavaScript
interceptions this trap can intercept these operations: object.getownpropertynames() object.getownpropertysymbols() object.keys() reflect.ownkeys() invariants if the following invariants are violated, the proxy will throw a type
error: the result of ownkeys() must be an array.
... const obj = {}; object.defineproperty(obj, 'a', { configurable: false, enumerable: true, value: 10 } ); const p = new proxy(obj, { ownkeys: function(target) { return [123, 12.5, true, false, undefined, null, {}, []]; } }); console.log(object.getownpropertynames(p)); // type
error: proxy [[ownpropertykeys]] must return an array // with only string and symbol elements specifications specification ecmascript (ecma-262)the definition of '[[ownpropertykeys]]' in that specification.
handler.preventExtensions() - JavaScript
interceptions this trap can intercept these operations: object.preventextensions() reflect.preventextensions() invariants if the following invariants are violated, the proxy will throw a type
error: object.preventextensions(proxy) only returns true if object.isextensible(proxy) is false.
... const p = new proxy({}, { preventextensions: function(target) { return true; } }); object.preventextensions(p); // type
error is thrown specifications specification ecmascript (ecma-262)the definition of '[[preventextensions]]' in that specification.
Proxy.revocable() - JavaScript
if the revoke() function gets called, the proxy becomes unusable: any trap to a handler will throw a type
error.
... examples using proxy.revocable var revocable = proxy.revocable({}, { get: function(target, name) { return "[[" + name + "]]"; } }); var proxy = revocable.proxy; console.log(proxy.foo); // "[[foo]]" revocable.revoke(); console.log(proxy.foo); // type
error is thrown proxy.foo = 1 // type
error again delete proxy.foo; // still type
error typeof proxy // "object", typeof doesn't trigger any trap specifications specification ecmascript (ecma-262)the definition of 'proxy revocation functions' in that specification.
Proxy - JavaScript
let validator = { set: function(obj, prop, value) { if (prop === 'age') { if (!number.isinteger(value)) { throw new type
error('the age is not an integer'); } if (value > 200) { throw new range
error('the age seems invalid'); } } // the default behavior to store the value obj[prop] = value; // indicate success return true; } }; const person = new proxy({}, validator); person.age = 100; console.log(person.age); // 100 person.age = 'young'; // throws an exception person...
...p]; if (prop === 'selected') { if (oldval) { oldval.setattribute('aria-selected', 'false'); } if (newval) { newval.setattribute('aria-selected', 'true'); } } // the default behavior to store the value obj[prop] = newval; // indicate success return true; } }); let i1 = view.selected = document.getelementbyid('item-1'); //giving
error here, i1 is null console.log(i1.getattribute('aria-selected')); // 'true' let i2 = view.selected = document.getelementbyid('item-2'); console.log(i1.getattribute('aria-selected')); // 'false' console.log(i2.getattribute('aria-selected')); // 'true' note: even if selected: !null, then giving oldval.setattribute is not a function value correction and an extra property the products proxy obj...
Reflect.getPrototypeOf() - JavaScript
exceptions a type
error, if target is not an object.
...ototypeof({}) // object.prototype reflect.getprototypeof(object.prototype) // null reflect.getprototypeof(object.create(null)) // null compared to object.getprototypeof() // same result for objects object.getprototypeof({}) // object.prototype reflect.getprototypeof({}) // object.prototype // both throw in es5 for non-objects object.getprototypeof('foo') // throws type
error reflect.getprototypeof('foo') // throws type
error // in es2015 only reflect throws, object coerces non-objects object.getprototypeof('foo') // string.prototype reflect.getprototypeof('foo') // throws type
error // to mimic the object es2015 behavior you need to coerce reflect.getprototypeof(object('foo')) // string.prototype specifications specification ecmascript (ecma...
SharedArrayBuffer() constructor - JavaScript
calling a sharedarraybuffer constructor as a function without new will throw a type
error.
... var sab = sharedarraybuffer(1024); // type
error: calling a builtin sharedarraybuffer constructor // without new is forbidden var sab = new sharedarraybuffer(1024); specifications specification ecmascript (ecma-262)the definition of 'sharedarraybuffer constructor' in that specification.
SharedArrayBuffer - JavaScript
calling a sharedarraybuffer constructor as a function without new will throw a type
error.
... var sab = sharedarraybuffer(1024); // type
error: calling a builtin sharedarraybuffer constructor // without new is forbidden var sab = new sharedarraybuffer(1024); constructor sharedarraybuffer() creates a new sharedarraybuffer object.
String.prototype.matchAll() - JavaScript
the regexp object must have the /g flag, otherwise a type
error will be thrown.
... const regexp = regexp('[a-c]',''); const str = 'abc'; str.matchall(regexp); // type
error matchall internally makes a clone of the regexp—so, unlike regexp.exec(), lastindex does not change as the string is scanned.
String.prototype.toLocaleLowerCase() - JavaScript
exceptions a range
error ("invalid language tag: xx_yy") is thrown if a locale argument isn't a valid language tag.
... a type
error ("invalid element in locales argument") is thrown if an array element isn't of type string.
String.prototype.toLocaleUpperCase() - JavaScript
exceptions a range
error ("invalid language tag: xx_yy") is thrown if a locale argument isn't a valid language tag.
... a type
error ("invalid element in locales argument") is thrown if an array element isn't of type string.
TypedArray.prototype.findIndex() - JavaScript
polyfill typedarray.prototype.findindex = array.prototype.findindex = array.prototype.findindex || function(evaluator, thisarg) { 'use strict'; if (!this) { throw new type
error('array.prototype.some called on null or undefined'); } if (typeof(evaluator) !== 'function') { if (typeof(evaluator) === 'string') { // attempt to convert it to a function if ( !
... (evaluator = eval(evaluator)) ){ throw new type
error(); } } else { throw new type
error(); } } var i; if (thisarg === undefined) { // optimize for thisarg for (i in this) { if (evaluator(this[i], i, this)) { return i; } } return -1; } for (i in this) { if (evaluator.call(thisarg, this[i], i, this)) { return i; } } return -1; }; examples find the index of a prime number in a typed array the following example finds the index of an element in the typed array that is a prime number (or returns -1 if there is no prime number).
TypedArray.from() - JavaScript
differences from array.from() some subtle distinctions between array.from() and typedarray.from(): if the thisarg value passed to typedarray.from() is not a constructor, typedarray.from() will throw a type
error, where array.from() defaults to creating a new array.
... if (!int8array.__proto__.from) { (function () { int8array.__proto__.from = function (obj, func, thisobj) { var typedarrayclass = int8array.__proto__; if(typeof this !== 'function') { throw new type
error('# is not a constructor'); } if (this.__proto__ !== typedarrayclass) { throw new type
error('this is not a typed array.'); } func = func || function (elem) { return elem; }; if (typeof func !== 'function') { throw new type
error('specified argument is not a function'); ...
Uint16Array() constructor - JavaScript
calling a uint16array constructor as a function without new, will throw a type
error from now on.
... var dv = uint16array([1, 2, 3]); // type
error: calling a builtin uint16array constructor // without new is forbidden var dv = new uint16array([1, 2, 3]); examples different ways to create a uint16array // from a length var uint16 = new uint16array(2); uint16[0] = 42; console.log(uint16[0]); // 42 console.log(uint16.length); // 2 console.log(uint16.bytes_per_element); // 2 // from an array var arr = new uint16array([21,31]); console.log(arr[1]); // 31 // from another typedarray var x = new uint16array([21, 31]); var y = new uint16array(x); console.log(y[0]); // 21 // from an arraybuffer var buffer = new arraybuffer(8); var z = new uint16array(buffer, 0, 4); // from an iterable var iterable = function*(){ yield* [1,2,3]; }(); var uint16 = new uint16array(iterable); // uint16array[1, 2, ...
WebAssembly.compile() - JavaScript
exceptions if buffersource is not a typed array, a type
error is thrown.
... if compilation fails, the promise rejects with a webassembly.compile
error.
decodeURI() - JavaScript
exceptions throws an uri
error ("malformed uri sequence") exception when encodeduri contains invalid character sequences.
... examples decoding a cyrillic url decodeuri('https://developer.mozilla.org/ru/docs/javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "https://developer.mozilla.org/ru/docs/javascript_шеллы" catching
errors try { var a = decodeuri('%e0%a4%a'); } catch(e) { console.
error(e); } // uri
error: malformed uri sequence specifications specification ecmascript (ecma-262)the definition of 'decodeuri' in that specification.
decodeURIComponent() - JavaScript
exceptions throws an uri
error ("malformed uri sequence") exception when used wrongly.
... examples decoding a cyrillic url component decodeuricomponent('javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "javascript_шеллы" catching
errors try { var a = decodeuricomponent('%e0%a4%a'); } catch(e) { console.
error(e); } // uri
error: malformed uri sequence decoding query parameters from a url decodeuricomponent cannot be used directly to parse query parameters from a url.
Iteration protocols - JavaScript
if a non-object value gets returned (such as false or undefined), a type
error ("iterator.next() returned a non-object value") will be thrown.
... using one is likely to result in runtime
errors or buggy behavior: let nonwellformediterable = {}; nonwellformediterable[symbol.iterator] = () => 1; [...nonwellformediterable]; // type
error: [] is not a function iterator examples simple iterator function makeiterator(array) { let nextindex = 0 return { next: function() { return nextindex < array.length ?
Spread syntax (...) - JavaScript
without spread syntax, this is done as: const arr1 = [0, 1, 2]; const arr2 = [3, 4, 5]; // append all items from arr2 onto arr1 arr1 = arr1.concat(arr2); with spread syntax this becomes: let arr1 = [0, 1, 2]; let arr2 = [3, 4, 5]; arr1 = [...arr1, ...arr2]; // arr1 is now [0, 1, 2, 3, 4, 5] // note: not to use const otherwise, it will give type
error (invalid assignment) array.prototype.unshift() is often used to insert an array of values at the start of an existing array.
... spread syntax (other than in the case of spread properties) can be applied only to iterable objects: const obj = {'key1': 'value1'}; const array = [...obj]; // type
error: obj is not iterable spread with many values when using spread syntax for function calls, be aware of the possibility of exceeding the javascript engine's argument length limit.
Unary plus (+) - JavaScript
using the operator on bigint values throws a type
error.
... examples usage with numbers const x = 1; const y = -1; console.log(+x); // 1 console.log(+y); // -1 usage with non-numbers +true // 1 +false // 0 +null // 0 +function(val){ return val } // nan +1n // throws type
error: cannot convert bigint value to number specifications specification ecmascript (ecma-262)the definition of 'unary plus operator' in that specification.
await - JavaScript
async function f4() { try { var z = await promise.reject(30); } catch(e) { console.
error(e); // 30 } } f4(); handling rejected promises handle rejected promise without try block.
... var response = await promisedfunction().catch((err) => { console.
error(err); }); // response will be undefined if the promise is rejected specifications specification ecmascript (ecma-262)the definition of 'async functions' in that specification.
Function expression - JavaScript
nothoisted(); // type
error: nothoisted is not a function var nothoisted = function() { console.log('bar'); }; named function expression if you want to refer to the current function inside the function body, you need to create a named function expression.
... var foo = function() {} foo.name // "foo" var foo2 = foo foo2.name // "foo" var bar = function baz() {} bar.name // "baz" console.log(foo === foo2); // true console.log(typeof baz); // undefined console.log(bar === baz); // false (
errors because baz == undefined) examples creating an unnamed function the following example defines an unnamed function and assigns it to x.
block - JavaScript
the same is true of const: const c = 1; { const c = 2; } console.log(c); // logs 1 and does not throw syntax
error...
... note that the block-scoped const c = 2 does not throw a syntax
error: identifier 'c' has already been declared because it can be declared uniquely within the block.
function* - JavaScript
much like a return statement, an
error is thrown inside the generator will make the generator finished -- unless caught within the generator's body.
...value: undefined, done: true } generator as a computed property class foo { *[symbol.iterator] () { yield 1; yield 2; } } const someobj = { *[symbol.iterator] () { yield 'a'; yield 'b'; } } console.log(array.from(new foo)); // [ 1, 2 ] console.log(array.from(someobj)); // [ 'a', 'b' ] generators are not constructable function* f() {} var obj = new f; // throws "type
error: f is not a constructor generator defined in an expression const foo = function* () { yield 10; yield 20; }; const bar = foo(); console.log(bar.next()); // {value: 10, done: false} generator example function* powers(n){ //endless loop to generate for(let current =n;; current *= n){ yield current; } } for(let power of powers(2)){ //controlling generator ...
label - JavaScript
it will throw a syntax
error (let is a reserved identifier).
... l: function f() {} in strict mode code, however, this will throw a syntax
error: 'use strict'; l: function f() {} // syntax
error: functions cannot be labelled generator functions can neither be labeled in strict code, nor in non-strict code: l: function* f() {} // syntax
error: generator functions cannot be labelled specifications specification ecmascript (ecma-262)the definition of 'labelled statement' in that specification.
switch - JavaScript
take a look at this example: const action = 'say_hello'; switch (action) { case 'say_hello': let message = 'hello'; console.log(message); break; case 'say_hi': let message = 'hi'; console.log(message); break; default: console.log('empty action received.'); break; } this example will output the
error uncaught syntax
error: identifier 'message' has already been declared which you were not probably expecting.
...d brackets let message = 'hello'; console.log(message); break; } // added brackets case 'say_hi': { // added brackets let message = 'hi'; console.log(message); break; } // added brackets default: { // added brackets console.log('empty action received.'); break; } // added brackets } this code will now output hello in the console as it should, without any
errors at all.
with - JavaScript
otherwise a reference
error is thrown.
...if you forget to define x in the object you pass as the second argument, or if there's some similar bug or confusion, you won't get an
error -- just unexpected results.
JavaScript reference - JavaScript
value properties infinity nan undefined globalthis function properties eval() isfinite() isnan() parsefloat() parseint() decodeuri() decodeuricomponent() encodeuri() encodeuricomponent() fundamental objects object function boolean symbol
error objects
error aggregate
error eval
error internal
error range
error reference
error syntax
error type
error uri
error numbers & dates number bigint math date text processing string regexp indexed collections array int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array bigint6...
...torfunction asyncfunction reflection reflect proxy internationalization intl intl.collator intl.datetimeformat intl.displaynames intl.listformat intl.locale intl.numberformat intl.pluralrules intl.relativetimeformat webassembly webassembly webassembly.module webassembly.instance webassembly.memory webassembly.table webassembly.compile
error webassembly.link
error webassembly.runtime
error statements javascript statements and declarations control flowblock break continue empty if...else switch throw try...catch declarations var let const functions and classes function function* async function return class iterations do...while for for each...in for...in for...of ...
MathML element reference - MathML
mathml presentation elements a to z math <math> (top-level element) a <maction> (binded actions to sub-expressions) <maligngroup> (alignment group) <malignmark> (alignment points) e <menclose> (enclosed contents) <m
error> (enclosed syntax
error messages) f <mfenced> (parentheses) <mfrac> (fraction) g <mglyph> (displaying non-standard symbols) i <mi> (identifier) l <mlabeledtr> (labeled row in a table or a matrix) <mlongdiv> (long division notation) m <mmultiscripts> (prescripts and tensor indices) n <mn> (number) o <mo> (operator) <mover> (overscript) p <mpadded> (spac...
...matrix) u <munder> (underscript) <munderover> (underscript-overscript pair) other elements <semantics> (container for semantic annotations) <annotation> (data annotations) <annotation-xml> (xml annotations) mathml presentation elements by category top-level elements <math> token elements <mglyph> <mi> <mn> <mo> <ms> <mspace> <mtext> general layout <menclose> <m
error> <mfenced> <mfrac> <mpadded> <mphantom> <mroot> <mrow> <msqrt> <mstyle> script and limit elements <mmultiscripts> <mover> <mprescripts> <msub> <msubsup> <msup> <munder> <munderover> <none> tabular math <maligngroup> <malignmark> <mlabeledtr> <mtable> <mtd> <mtr> elementary math <mlongdiv> <mscarries> <mscarry> <msgroup> <msline> <msrow> <mstack> uncat...
Navigation and resource timings - Web Performance
if the transport layer reports an
error and the connection establishment is started again, the last connection establishment end time is given.
...if the transport layer reports an
error and the connection establishment is started again, the last connection establishment start time is given.
Progressive web app structure - Progressive web apps (PWAs)
progressive: start with the "good, old basic website” and progressively add new features while remembering to detect if they are available in the browser and gracefully handle any
errors that crop up if support is not available.
...it provides fine-grained control — the stream can be started, chained with another stream, cancelled, checked for
errors, and more.
Structural overview of progressive web apps - Progressive web apps (PWAs)
progressive: start with the "good, old basic website” and progressively add new features while remembering to detect if they are available in the browser and gracefully handle any
errors that crop up if support is not available.
...it provides fine-grained control: the stream can be started, chained with another stream, canceled, checked for
errors, and more.
Understanding WebAssembly text format - WebAssembly
if the callee doesn’t have a matching signature (say an f32 is returned instead), a webassembly.runtime
error is thrown.
...2) local.get $i call_indirect (type $return_i32)) ) we load it into a webpage using the following javascript: webassembly.instantiatestreaming(fetch('wasm-table.wasm')) .then(obj => { console.log(obj.instance.exports.callbyindex(0)); // returns 42 console.log(obj.instance.exports.callbyindex(1)); // returns 13 console.log(obj.instance.exports.callbyindex(2)); // returns an
error, because there is no index position 2 in the table }); note: you can find this example on github as wasm-table.html (see it live also).
Content Scripts - Archive of obsolete content
for example, this content script will fail with the
error "themessage is not defined": var themessage = "hello from content script!"; anelement.setattribute("onclick", "alert(themessage);"); second, if you define an event listener by direct assignment to a global event handler like onclick, then the assignment might be overridden by the page.
Content Processes - Archive of obsolete content
a full discussion of the different kinds of security wrappers and how they work is out of scope for this document, but the main point is this: security wrappers are very complex, and very
error-prone.
notifications - Archive of obsolete content
if the user's system does not support desktop notifications or if its notifications service is not running: if firefox was started normally, notifications are logged to firefox's
error console if the user launched firefox from the command line, notifications are logged to the terminal.
XUL Parser in Python/source - Archive of obsolete content
def strip(snip): t = re.sub('http://.*?\s', '', snip) return t class xulparser(xmllib.xmlparser): def unknown_starttag(self, t, a): name = strip(t) if name not in el_list: el_list[name] = {} for attr,val in a.items(): el_list[name][strip(attr)] = strip(val) def syntax_
error(self, message): pass p = xulparser() cmd = 'dir /s /b *.xul' chrome_dir = 'c:\program files\netscape\netscape 6\chrome' os.chdir(chrome_dir) files = os.popen(cmd).readlines() for file in files: file = file.strip() print '** ' + file + ' **' data = open(file).read() p.feed(data) w.write('<html><h3>periodic table of xul elements</h3>') w.write('<table><style>.head {font-weight: bold; backg...
XUL accessibility tool - Archive of obsolete content
future work the following things have been suggested or are planned for a future version of the tool: new tests: (aaronlev) warning: hardcoded color and pixel sizings (aaronlev)
error: duplicate accesskey in a dialog (already have this for menus) (aaronlev)
error: form control without accesskey (aaronlev) warning: accesskey as lowercase letter with descender (underlined g,j,y,q,p are hard to read, not recommended) (aaronandy) list of things to check manually, such as a list oftrees in the document (make sure they have accessible column picker equivs) or a list of toolbarbut...
stringbundle - Archive of obsolete content
for example, the following defines two properties: message.display
error=an
error occured trying to display this message message.namealreadyused=the name %s is already being used by another account.
titlebar - Archive of obsolete content
is.only.xul" width="300" height="200" style="background: transparent; -moz-appearance: none;"> <titlebar flex="1" oncommand="close()" style="background: rgba(30, 30, 30, 0.9); -moz-border-radius: 10px; -moz-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); margin: 8px 12px 16px;"/> </window> it can be opened from the
error console like this: open("file:///users/markus/sites/hudwindow.xul", "", "chrome=1, titlebar=0") attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu...
Deploying XULRunner - Archive of obsolete content
other executables and libraries the core changes to xul and gecko that require this new file layout were implemented in gecko 34, except that the xulrunner application was not updated to know about the change, so it will report an
error: "unable to load xpcom." xulrunner was fixed in gecko 39.
Getting started with XULRunner - Archive of obsolete content
ip once installed, you can run the application: /library/frameworks/xul.framework/xulrunner-bin "/applications/finkle/testapp.app/contents/resources/application.ini" you may run it without installing (but with the menu bar and dock icon missing) in os x by typing: /library/frameworks/xul.framework/xulrunner-bin "/<full path>/testapp/application.ini" note: the full path is required or a "
error: couldn't parse application.ini."-message will be returned.
XULRunner tips - Archive of obsolete content
closewhendone", true); pref("browser.download.manager.opendelay", 0); pref("browser.download.manager.focuswhenstarting", false); pref("browser.download.manager.flashcount", 2); // pref("alerts.slideincrement", 1); pref("alerts.slideincrementtime", 10); pref("alerts.totalopentime", 4000); pref("alerts.height", 50); if you are missing preferences that a dialog requires, you will get the following
errors: component returned failure code: 0x8000ffff (ns_
error_unexpected) [nsiprefbranch.getboolpref]
error: dialog has no properties source file: chrome://mozapps/content/downloads/u...ontenttype.xul line: 1 enabling password manager these preferences seem to be the default in firefox, however, they are missing in xulrunner.
Using SOAP in XULRunner 1.9 - Archive of obsolete content
(there is a diff below.) you'll need: sasoapclient.js saxmlutils.js making a soap call var url = 'http://example.com/soap/'; var ns = 'http://example.com/soap/namespace'; var method = 'foo'; var params = { 'foo': 'bar', 'baz': 'bang' }; var callback = function(obj) { components.utils.report
error(obj.tosource()); }; soapclient.proxy = url; var body = new soapobject(method); body.ns = ns; for (var k in params) { body.appendchild(new soapobject(k).val(params[k])); } var req = new soaprequest(url, body); req.action = ns + '#' + method; soapclient.sendrequest(req, callback); diff between jqsoapclient.js and sasoapclient.js 42c42 < var jsout = $.xmltojson(xdata.responsexml); --- > ...
calICalendarView - Archive of obsolete content
(for instance, calendar-month-view will show all dates from the start of the week of astartdate to the end of the week of aenddate.) setdatelist void setdatelist(in unsigned long acount, [array,size_is(acount)] in calidatetime adates); this function can only be called if supportsdisjointdates is true and will throw an
error if it is not.
mozbrowsericonchange
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsericonchange", function( event ) { console.log("the url of the new favicon is:" + event.details.href); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserloadend
selector("iframe"); browser.addeventlistener('mozbrowserloadend',function(e) { stopreload.textcontent = 'r'; console.log(e.detail.backgroundcolor); controls.style.background = e.detail.backgroundcolor; }); browser.addeventlistener('mozbrowserloadend',function() { stopreload.textcontent = 'r'; }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserloadstart
var browser = document.queryselector("iframe"); browser.addeventlistener('mozbrowserloadstart',function() { stopreload.textcontent = 'x'; }); browser.addeventlistener('mozbrowserloadend',function() { stopreload.textcontent = 'r'; }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserlocationchange
var browser = document.queryselector("iframe"); browser.addeventlistener('mozbrowserlocationchange', function (event) { urlbar.value = event.detail.url; }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsermanifestchange
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsermanifestchange", function(event) { console.log("new manifest url: " + event.details.href); }); related events mozbrowserasyncscroll mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsermetachange
its name is " + event.details.name + ", and its content is " + event.details.content + "."); }); related events mozbrowserasyncscroll mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowseropensearch
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowseropensearch", function( event ) { console.log("new search engine encountered: " + event.details.title); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange ...
mozbrowseropentab
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowseropentab", function( event ) { console.log("a new document has opened containing the content at " + event.details.url + "."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowseropenwindow
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowseropenwindow", function( event ) { console.log("a new window has opened containing the content at " + event.details.url + "."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserresize
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserresize", function( event ) { console.log("the new window size is " + event.details.width + " x " + event.details.height + "."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserscroll
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserscroll", function( event ) { console.log("the new scroll position is " + event.details.left + " across and " + event.details.top + "down."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserscrollareachanged
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserscrollareachanged", function( event ) { console.log("the new scroll area is " + event.details.width + " x " + event.details.height + "."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserscrollviewchange
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserscrollviewchange", function( event ) { console.log("scrolling has " + event.details.state + "."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsersecuritychange
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsersecuritychange", function( event ) { console.log("the ssl state is:" + event.details.state); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserselectionstatechanged
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserselectionstatechanged", function( event ) { if(event.details.visible) { console.log("the current selection is visible."); } else { console.log("the current selection is not visible."); } }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowser
error mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
NS_ConvertASCIItoUTF16
@param a
errorcode will contain
error if one occurs @return float rep of string value parameters print32* a
errorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* a
errorcode pruint32 aradix mid pruint32 mid(nsstring&, pruint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, p...
NS_ConvertUTF16toUTF8
@param a
errorcode will contain
error if one occurs @return float rep of string value parameters print32* a
errorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* a
errorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&...
NS_ConvertUTF8toUTF16
@param a
errorcode will contain
error if one occurs @return float rep of string value parameters print32* a
errorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* a
errorcode pruint32 aradix mid pruint32 mid(nsstring&, pruint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, p...
NS_LossyConvertUTF16toASCII
@param a
errorcode will contain
error if one occurs @return float rep of string value parameters print32* a
errorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* a
errorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&...
NS_OVERRIDE
a compiler with static-checking enabled will issue the following
error: test.cpp:8:
error: ns_override function b::getfoo(nsifoo**) does not override a base class method with the same name and signature.
NS_POSTCONDITION
syntax ns_postcondition(expressiontotest, "
error text"); see also ns_precondition ns_assertion ...
NS_PRECONDITION
syntax ns_precondition(expressiontotest, "
error text"); see also ns_assertion ns_postcondition ...
nsAdoptingCString
@param a
errorcode will contain
error if one occurs @return float rep of string value parameters print32* a
errorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* a
errorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&...
nsAdoptingString
@param a
errorcode will contain
error if one occurs @return float rep of string value parameters print32* a
errorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* a
errorcode pruint32 aradix mid pruint32 mid(nsstring&, pruint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, p...
nsAutoString
@param a
errorcode will contain
error if one occurs @return float rep of string value parameters print32* a
errorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* a
errorcode pruint32 aradix mid pruint32 mid(nsstring&, pruint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, p...
nsCAutoString
@param a
errorcode will contain
error if one occurs @return float rep of string value parameters print32* a
errorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* a
errorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount ...
nsCString
@param a
errorcode will contain
error if one occurs @return float rep of string value parameters print32* a
errorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* a
errorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&...
nsDependentCString
@param a
errorcode will contain
error if one occurs @return float rep of string value parameters print32* a
errorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* a
errorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&...
nsDependentString
@param a
errorcode will contain
error if one occurs @return float rep of string value parameters print32* a
errorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* a
errorcode pruint32 aradix mid pruint32 mid(nsstring&, pruint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, p...
nsFixedCString
@param a
errorcode will contain
error if one occurs @return float rep of string value parameters print32* a
errorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* a
errorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&...
AudioBufferSourceNode.playbackRate - Web APIs
ue); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; }, function(e){"
error with decoding audio data" + e.err}); } request.send(); } // wire up buttons to stop and play audio, and range slider control play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); playbackcontrol.removeattribute('disabled'); } stop.onclick = function() { source.stop(0); play.removeattribute('disabled'); playbackcontrol.setattribut...
AudioContext.createMediaStreamSource() - Web APIs
st the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // get new mouse pointer coordinates when mouse is moved // then set new gain value range.oninput = function() { biquadfilter.gain.value = range.value; } }) .catch(function(err) { console.log('the following gum
error occured: ' + err); }); } else { console.log('getusermedia not supported on your browser!'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; note: as a consequence of calling createmediastreamsource(), audio playback from the media stream will be re-routed into the processing graph of the audiocontext.
AudioContext.createMediaStreamTrackSource() - Web APIs
d = true; }; let audioctx = new audiocontext(); let source = audioctx.createmediastreamsource(stream); let biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 3000; biquadfilter.gain.value = 20; source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); }) .catch(function(err) { // handle getusermedia()
error }); specifications specification status comment web audio apithe definition of 'createmediastreamtracksource()' in that specification.
AudioNode - Web APIs
keep in mind that microsoft edge does not yet appear to support the constructors; it will throw a "function expected"
error when you use the constructors.
AudioParam.exponentialRampToValueAtTime() - Web APIs
set buttons to do something onclick exprampplus.onclick = function() { gainnode.gain.exponentialramptovalueattime(1.0, audioctx.currenttime + 2); } exprampminus.onclick = function() { gainnode.gain.exponentialramptovalueattime(0.01, audioctx.currenttime + 2); } note: a value of 0.01 was used for the value to ramp down to in the last function rather than 0, as an invalid or illegal string
error is thrown if 0 is used — the value needs to be positive.
AudioProcessingEvent - Web APIs
// load in an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"
error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent) { // the input buffer is the song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the output buffer contains the samples that will be modified and played var outputbuffer = audioprocessingeven...
AudioWorkletNode - Web APIs
event handlers audioworkletnode.onprocessor
error fired when an
error is thrown in associated audioworkletprocessor.
AuthenticatorAssertionResponse.authenticatorData - Web APIs
timeout: 60000 }; navigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var authenticatordata = assertionpkcred.response.authenticatordata; // maybe try to convert the authenticatordata to see what's inside // send response and client extensions to the server so that it can // go on with the authentication }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'authenticatordata' in that specification.
AuthenticatorAssertionResponse.signature - Web APIs
ge: new uint8array(26), // will be another value, provided by the relying party server timeout: 60000 }; navigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var signature = assertionpkcred.response.signature; // send response and client extensions to the server so that it can // go on with the authentication }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'signature' in that specification.
AuthenticatorAssertionResponse.userHandle - Web APIs
: new uint8array(26), // will be another value, provided by the relying party server timeout: 60000 }; navigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var userhandle = assertionpkcred.response.userhandle; // send response and client extensions to the server so that it can // go on with the authentication }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'userhandle' in that specification.
AuthenticatorAssertionResponse - Web APIs
nt8array([/* bytes sent from the server */]) }; navigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { var assertionresponse = credentialinfoassertion.response; // do something specific with the response // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'authenticatorassertionresponse interface' in that specification.
AuthenticatorAttestationResponse.attestationObject - Web APIs
{ type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var attestationobj = newcredentialinfo.response.attestationobject; // this will be a cbor encoded arraybuffer // do something with the response // (sending it back to the relying party server maybe?) }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'attestationobject' in that specification.
Element.setAttribute() - Web APIs
exceptions invalidcharacter
error the specified attribute name contains one or more characters which are not valid in attribute names.
Element.setAttributeNodeNS() - Web APIs
note that if you try to set without cloning the node, mozilla gives an ns_
error_dom_inuse_attribute_err "attribute already in use"
error, as the dom requires cloning for attr to be reused (unlike other nodes which can be moved).
Event.eventPhase - Web APIs
"bubbling" : "
error"; divinfo.innerhtml += e.currenttarget.id + "; eventphase: " + level + "<br/>"; } function clear() { for (let i = 0; i < divs.length; i++) { if (divs[i].id != "divinfo") { divs[i].style.backgroundcolor = (i & 1) ?
Event.type - Web APIs
it is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or
error.
Event - Web APIs
animationevent audioprocessingevent beforeinputevent beforeunloadevent blobevent clipboardevent closeevent compositionevent cssfontfaceloadevent customevent devicelightevent devicemotionevent deviceorientationevent deviceproximityevent domtransactionevent dragevent editingbeforeinputevent
errorevent fetchevent focusevent gamepadevent hashchangeevent idbversionchangeevent inputevent keyboardevent mediastreamevent messageevent mouseevent mutationevent offlineaudiocompletionevent overconstrained
error pagetransitionevent paymentrequestupdateevent pointerevent popstateevent progressevent relatedevent rtcdatachannelevent rtcidentity
errorevent rtcidentityevent rtcpeercon...
EventTarget.addEventListener() - Web APIs
for example, an event handler callback that can be used to handle both fullscreenchange and fullscreen
error might look like this: function eventhandler(event) { if (event.type == 'fullscreenchange') { /* handle a full screen toggle */ } else /* fullscreen
error */ { /* handle a full screen toggle
error */ } } safely detecting option support in older versions of the dom specification, the third parameter of addeventlistener() was a boolean value indicating whether or not to use capture.
Fetch API - Web APIs
differences from jquery the fetch specification differs from jquery.ajax() in three main ways: the promise returned from fetch() won’t reject on http
error status even if the response is an http 404 or 500.
FileReader: abort event - Web APIs
t.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('
error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdataurl(selectedfile); } reader.abort(); } fileinput.addeventlistener('change', handleselected); result specifications specif...
FileReader: load event - Web APIs
t.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('
error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdataurl(selectedfile); } } fileinput.addeventlistener('change', handleselected); result specifications specification status ...
FileReader: loadend event - Web APIs
t.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('
error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdataurl(selectedfile); } } fileinput.addeventlistener('change', handleselected); result specifications specification status ...
FileReader: loadstart event - Web APIs
t.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('
error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdataurl(selectedfile); } } fileinput.addeventlistener('change', handleselected); result specifications specification status ...
FileReader: progress event - Web APIs
t.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('
error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { addlisteners(reader); reader.readasdataurl(selectedfile); } } fileinput.addeventlistener('change', handleselected); result specifications specification status ...
FileSystemDirectoryEntry.createReader() - Web APIs
function readdirectory(directory) { let dirreader = directory.createreader(); let entries = []; let getentries = function() { dirreader.readentries(function(results) { if (results.length) { entries = entries.concat(toarray(results)); getentries(); } }, function(
error) { /* handle
error --
error is a file
error object */ }); }; getentries(); return entries; } this works by creating an internal function, getentries(), which calls itself recursively to get all the entries in the directory, concatenating each batch to the array.
FileSystemEntry.fullPath - Web APIs
function gotfilesystem(fs) { let path = ""; fs.root.getfile("data.json", { create: true, exclusive: true }, function(entry) { path = fullpath; }, handle
error(
error)); return path; } obviously, this is somewhat contrived, since we know that the file's full path is "/data.json", having just looked it up ourselves, but the concept holds up for scenarios in which you don't know it.
FileSystemEntry - Web APIs
// opening a file system with temporary storage window.requestfilesystem(temporary, 1024*1024 /*1mb*/, function(fs) { fs.root.getfile('log.txt', {}, function(fileentry) { fileentry.remove(function() { console.log('file removed.'); }, on
error); }, on
error); }, on
error); properties this interface provides the following properties.
FontFace.loaded - Web APIs
the loaded read-only property of the fontface interface returns a promise that resolves with the current fontface object when the font specified in the object's constructor is done loading or rejects with a syntax
error.
FontFaceSet - Web APIs
fontfaceset.onloading
error an eventlistener called whenever an event of type loading
error is fired, indicating that an
error occurred whilst loading a font-face set.
Using FormData Objects - Web APIs
eventlistener('submit', function(ev) { var ooutput = document.queryselector("div"), odata = new formdata(form); odata.append("customfield", "this is some extra data"); var oreq = new xmlhttprequest(); oreq.open("post", "stash.php", true); oreq.onload = function(oevent) { if (oreq.status == 200) { ooutput.innerhtml = "uploaded!"; } else { ooutput.innerhtml = "
error " + oreq.status + " occurred when trying to upload your file.<br \/>"; } }; oreq.send(odata); ev.preventdefault(); }, false); note: if you pass in a reference to the form, the request method specified in the form will be used over the method specified in the open() call.
FullscreenOptions.navigationUI - Web APIs
let elem = document.documentelement; elem.requestfullscreen({ navigationui: "show" }).then({}).catch(err => { alert(`an
error occurred while trying to switch into full-screen mode: ${err.message} (${err.name})`); }); the promise's resolve handler does nothing, but if the promise is rejected, an
error message is displayed by calling alert().
GainNode.gain - Web APIs
ndow.webkitaudiocontext)(); var gainnode = audioctx.creategain(); var mute = document.queryselector('.mute'); var source; if (navigator.mediadevices.getusermedia) { navigator.mediadevices.getusermedia ( // constraints - only audio needed for this app { audio: true }, // success callback function(stream) { source = audioctx.createmediastreamsource(stream); }, //
error callback function(err) { console.log('the following gum
error occured: ' + err); } ); } else { console.log('getusermedia not supported on your browser!'); } source.connect(gainnode); gainnode.connect(audioctx.destination); ...
GainNode - Web APIs
ndow.webkitaudiocontext)(); var gainnode = audioctx.creategain(); var mute = document.queryselector('.mute'); var source; if (navigator.mediadevices.getusermedia) { navigator.mediadevices.getusermedia ( // constraints - only audio needed for this app { audio: true }, // success callback function(stream) { source = audioctx.createmediastreamsource(stream); }, //
error callback function(err) { console.log('the following gum
error occured: ' + err); } ); } else { console.log('getusermedia not supported on your browser!'); } source.connect(gainnode); gainnode.connect(audioctx.destination); ...
HTMLCanvasElement.toBlob() - Web APIs
exceptions security
error the canvas's bitmap is not origin clean; at least some of its contents come from secure examples getting a file representing the canvas once you have drawn content into a canvas, you can convert it into a file of any supported image format.
HTMLCanvasElement.toDataURL() - Web APIs
exceptions security
error the canvas's bitmap is not origin clean; at least some of its contents have or may have been loaded from a site other than the one from which the document itself was loaded.
IDBObjectStore.keyPath - Web APIs
30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.on
error = function(event) { note.innerhtml += '<li>transaction not opened due to
error.
IDBObjectStore.transaction - Web APIs
30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.on
error = function(event) { note.innerhtml += '<li>transaction not opened due to
error.
IDBTransaction.db - Web APIs
day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.on
error = function(event) { note.innerhtml += '<li>transaction not opened due to
error.
IDBTransaction.mode - Web APIs
day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.on
error = function(event) { note.innerhtml += '<li>transaction not opened due to
error.
IDBTransaction.onabort - Web APIs
day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.on
error = function(event) { note.innerhtml += '<li>transaction not opened due to
error: ' + transaction.
error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report t...
IDBTransaction.oncomplete - Web APIs
day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.on
error = function(event) { note.innerhtml += '<li>transaction not opened due to
error: ' + transaction.
error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report t...
ImageCapture() constructor - Web APIs
navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); }) .catch(
error => console.log(
error)); specifications specification status comment mediastream image capturethe definition of 'imagecapture' in that specification.
ImageCapture.getPhotoCapabilities() - Web APIs
return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.min = photocapabilities.imagewidth.min; input.max = photocapabilities.imagewidth.max; input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(
error => console.log('argh!',
error.name ||
error)); specifications specification status comment mediastream image capturethe definition of 'getphotocapabilities()' in that specification.
ImageCapture.getPhotoSettings() - Web APIs
return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.min = photocapabilities.imagewidth.min; input.max = photocapabilities.imagewidth.max; input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(
error => console.log('argh!',
error.name ||
error)); specifications specification status comment mediastream image capturethe definition of 'getphotosettings()' in that specification.
ImageCapture.grabFrame() - Web APIs
ocument.queryselector('canvas'); grabframebutton.onclick = grabframe; function grabframe() { imagecapture.grabframe() .then(function(imagebitmap) { console.log('grabbed frame:', imagebitmap); canvas.width = imagebitmap.width; canvas.height = imagebitmap.height; canvas.getcontext('2d').drawimage(imagebitmap, 0, 0); canvas.classlist.remove('hidden'); }) .catch(function(
error) { console.log('grabframe()
error: ',
error); }); } specifications specification status comment mediastream image capturethe definition of 'grabframe()' in that specification.
ImageCapture.takePhoto() - Web APIs
var takephotobutton = document.queryselector('button#takephoto'); var canvas = document.queryselector('canvas'); takephotobutton.onclick = takephoto; function takephoto() { imagecapture.takephoto().then(function(blob) { console.log('took photo:', blob); img.classlist.remove('hidden'); img.src = url.createobjecturl(blob); }).catch(function(
error) { console.log('takephoto()
error: ',
error); }); } specifications specification status comment mediastream image capturethe definition of 'takephoto()' in that specification.
ImageData() - Web APIs
errors thrown indexsize
error thrown if array is specified, but its length is not a multiple of (4 * width) or (4 * width * height).
MediaSettingsRange - Web APIs
return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.min = photocapabilities.imagewidth.min; input.max = photocapabilities.imagewidth.max; input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(
error => console.log('argh!',
error.name ||
error)); specifications specification status comment mediastream image capturethe definition of 'mediasettingsrange' in that specification.
MediaSource.MediaSource() - Web APIs
ng codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.
error('unsupported mime type or codec: ', mimecodec); } ...
MediaSource.isTypeSupported() - Web APIs
ng codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.
error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystat...
MediaSource.readyState - Web APIs
example written by nick desaulniers (view the full demo live, or download the source for further investigation.) if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.
error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystat...
MediaSource - Web APIs
codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.
error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystat...
MediaStreamTrackAudioSourceNode - Web APIs
st the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // get new mouse pointer coordinates when mouse is moved // then set new gain value range.oninput = function() { biquadfilter.gain.value = range.value; } }) .catch(function(err) { console.log('the following gum
error occured: ' + err); }); } else { console.log('getusermedia not supported on your browser!'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; note: as a consequence of calling createmediastreamsource(), audio playback from the media stream will be re-routed into the processing graph of the audiocontext.
MediaStreamTrackAudioSourceOptions.mediaStreamTrack - Web APIs
etusermedia) { navigator.mediadevices.getusermedia ( { audio: true, video: false }).then(function(stream) { let options = { mediastreamtrack: stream.getaudiotracks()[0]; } let source = new mediastreamtrackaudiosourcenode(audioctx, options); source.connect(audioctx.destination); }).catch(function(err) { console.log('the following gum
error occured: ' + err); }); } else { console.log('new getusermedia not supported on your browser!'); } specifications specification status comment web audio apithe definition of 'mediastreamtrackaudiosourceoptions.mediastream' in that specification.
MediaStream Image Capture API - Web APIs
though a mediastream holds several types of tracks and provides multiple methods for retrieving them, the imagecapture constructor will throw a domexception of type notsupported
error if mediastreamtrack.kind is not "video".
MediaTrackConstraints.autoGainControl - Web APIs
if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting for the automatic gain control feature; if it can't be met, then the request will result in an
error.
MediaTrackConstraints.echoCancellation - Web APIs
if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting for the echo cancellation feature; if it can't be met, then the request will result in an
error.
MediaTrackConstraints.noiseSuppression - Web APIs
if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting for the noise suppression feature; if it can't be met, then the request will result in an
error.
MediaTrackSupportedConstraints.cursor - Web APIs
tedconstraints = navigator.mediadevices.getsupportedconstraints(); let displaymediaoptions = { video: { displaysurface: "browser" }, audio: false; }; if (supportedconstraints.cursor) { displaymediaoptions.video.cursor = "always"; } try { videoelem.srcobject = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); } catch(err) { /* handle the
error */ } } specifications specification status comment screen capturethe definition of 'mediatracksupportedconstraints.cursor' in that specification.
PaymentRequest: shippingaddresschange event - Web APIs
paymentrequest = new paymentrequest(methoddata, details, options); paymentrequest.addeventlistener("shippingaddresschange", event => { let detailsupdate = checkaddress(paymentrequest.shippingaddress); event.updatewith(detailsupate); }, false); const checkaddress = theaddress => { let detailsupdate = {}; // check the address, return a paymentdetailsupdate object // with any changes or
errors.
PaymentResponse.onpayerdetailchange - Web APIs
ame(payername)); oldpayername = payername; } if (oldpayeremail !== payeremail) { promisestovalidate.push(validateemail(payeremail)); oldpayeremail = payeremail; } if (oldpayerphone !== payerphone) { promisestovalidate.push(validatephone(payerphone)); oldpayerphone = payerphone; } // as each validation promise resolves, add the results of the // validation to the
errors list const
errors = await promise.all(promisestovalidate).then(results => results.reduce((
errors, result), object.assign(
errors, result)) ); // if we found any
errors, wait for them to be corrected if (object.getownpropertynames(
errors).length) { await response.retry(
errors); } else { // we have a good payment; send the data to the server await fetch("/pay-for-things...
PaymentResponse.shippingAddress - Web APIs
}).catch(function(err) { console.
error("uh oh, something bad happened", err.message); }); function updatedetails(details, shippingaddress, resolve) { if (shippingaddress.country === 'us') { var shippingoption = { id: '', label: '', amount: {currency: 'usd', value: '0.00'}, selected: true }; if (shippingaddress.region === 'mo') { shippingoption.id = 'mo'; shippingoption.label = 'free s...
PaymentResponse.shippingOption - Web APIs
}).catch(function(err) { console.
error("uh oh, something bad happened", err.message); }); function updatedetails(details, shippingoption, resolve, reject) { var selectedshippingoption; var othershippingoption; if (shippingoption === 'standard') { selectedshippingoption = details.shippingoptions[0]; othershippingoption = details.shippingoptions[1]; details.total.amount.value = '55.00'; } else if (shippingoption ===...
PaymentResponse - Web APIs
methods paymentresponse.retry() secure context if something is wrong with the payment response's data (and there is a recoverable
error), this method allows a merchant to request that the user retry the payment.
PerformanceServerTiming - Web APIs
his: const http = require('http'); function requesthandler(request, response) { const headers = { 'server-timing': ` cache;desc="cache read";dur=23.2, db;dur=53, app;dur=47.2 `.replace(/\n/g, '') }; response.writehead(200, headers); response.write(''); return settimeout(_ => { response.end(); }, 1000) }; http.createserver(requesthandler).listen(3000).on('
error', console.
error); the performanceservertiming entries are now observable from javascript via the performanceresourcetiming.servertiming property: let entries = performance.getentriesbytype('resource'); console.log(entries[0].servertiming); // 0: performanceservertiming {name: "cache", duration: 23.2, description: "cache read"} // 1: performanceservertiming {name: "db", duration: 53, description...
Permissions.query() - Web APIs
exceptions exception explanation type
error retrieving the permissiondescriptor information failed in some way, or the permission doesn't exist or is currently unsupported (e.g.
Permissions.revoke() - Web APIs
exceptions type
error retrieving the permissiondescriptor information failed in some way, or the permission doesn't exist or is currently unsupported (e.g.
PhotoCapabilities - Web APIs
return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.min = photocapabilities.imagewidth.min; input.max = photocapabilities.imagewidth.max; input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(
error => console.log('argh!',
error.name ||
error)); specifications specification status comment mediastream image capturethe definition of 'photocapabilities' in that specification.
Multi-touch interaction - Web APIs
function get_cache(ev) { // return the cache for this event's target element switch(ev.target.id) { case "target1": return evcache1; case "target2": return evcache2; case "target3": return evcache3; default: log("
error with cache handling",ev); } } function push_event(ev) { // save this event in the target's cache var cache = get_cache(ev); cache.push(ev); } function remove_event(ev) { // remove this event from the target's cache var cache = get_cache(ev); for (var i = 0; i < cache.length; i++) { if (cache[i].pointerid == ev.pointerid) { cache.splice(i, 1); break; } } } update backgr...
PublicKeyCredential.getClientExtensionResults() - Web APIs
displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var mybuffer = newcredentialinfo.getclientextensionresults(); // mybuffer will contain the result of any of the processing of the "loc" and "uvi" extensions }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'getclientextensionresults()' in that specification.
PublicKeyCredential.id - Web APIs
credparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var id = newcredentialinfo.id; // do something with the id // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'id' in that specification.
PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() - Web APIs
amples publickeycredential.isuserverifyingplatformauthenticatoravailable() .then(function(available){ if(available){ // we can proceed with the creation of a publickeycredential // with this authenticator } else { // use another kind of authenticator or a classical login/password // workflow } }).catch(function(err){ // something went wrong console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'isuserverifyingplatformauthenticatoravailable' in that specification.
PublicKeyCredential.rawId - Web APIs
8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey: options }) .then(function (pubkeycredential) { var rawid = pubkeycredential.rawid; // do something with rawid }).catch(function (err) { // deal with any
error }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'rawid' in that specification.
PublicKeyCredential.response - Web APIs
y", alg: -7 } ] }; navigator.credentials.create({ publickey: options }) .then(function (pubkeycredential) { var response = pubkeycredential.response; var clientextresults = pubkeycredential.getclientextensionresults(); // send response and client extensions to the server so that it can validate // and create credentials }).catch(function (err) { // deal with any
error }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'response' in that specification.
PublicKeyCredentialCreationOptions.attestation - Web APIs
name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'attestation' in that specification.
PublicKeyCredentialCreationOptions.authenticatorSelection - Web APIs
h user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'authenticatorselection' in that specification.
PublicKeyCredentialCreationOptions.challenge - Web APIs
name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'challenge' in that specification.
PublicKeyCredentialCreationOptions.excludeCredentials - Web APIs
h user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'excludecredentials' in that specification.
PublicKeyCredentialCreationOptions.extensions - Web APIs
r.credentials.create({ publickey }) .then(function (newcredentialinfo) { // mybuffer will contain the result of any of the processing of the extensions var mybuffer = newcredentialinfo.getclientextensionresults(); // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'extensions' in that specification.
PublicKeyCredentialCreationOptions.pubKeyCredParams - Web APIs
}, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", } }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'pubkeycredparams' in that specification.
PublicKeyCredentialCreationOptions.rp - Web APIs
name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'rp' in that specification.
PublicKeyCredentialCreationOptions.timeout - Web APIs
name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'timeout' in that specification.
PublicKeyCredentialCreationOptions.user - Web APIs
doe", icon: "https://gravatar.com/avatar/jdoe.png" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.
error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'user' in that specification.
PublicKeyCredentialCreationOptions - Web APIs
ate(createcredentialoptions) .then(function (newcredentialinfo) { var attestationresponse = newcredentialinfo.response; var clientextensionsoutputs = newcredentialinfo.getclientextensionsresults(); // send the response to the relying party server // it will verify the content and integrity before // creating a new credential }).catch(function (err) { // deal with any
error properly console.
error(err); });; specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'publickeycredentialcreationoptions dictionary' in that specification.
Web Authentication API - Web APIs
ar idlist = [{ id: cred.rawid, transports: ["usb", "nfc", "ble"], type: "public-key" }]; getcredentialdefaultargs.publickey.allowcredentials = idlist; return navigator.credentials.get(getcredentialdefaultargs); }) .then((assertion) => { console.log("assertion", assertion); }) .catch((err) => { console.log("
error", err); }); mozilla demo website and its source code.
Web Crypto API - Web APIs
errors in security system design and implementation can make the security of the system completely ineffective.
Window.captureEvents() - Web APIs
syntax window.captureevents(eventtype) eventtype is a combination of the following values: event.abort, event.blur, event.click, event.change, event.dblclick, event.dragddrop, event.
error, event.focus, event.keydown, event.keypress, event.keyup, event.load, event.mousedown, event.mousemove, event.mouseout, event.mouseover, event.mouseup, event.move, event.reset, event.resize, event.select, event.submit, event.unload.
Window.close() - Web APIs
if the window was not opened by a script, an
error similar to this one appears in the console: scripts may not close windows that were not opened by script.
Window.console - Web APIs
console.log("an
error occurred while loading the content"); the next example logs an object to the console, with the object's fields expandable using disclosure widgets: console.dir(someobject); see usage in console for more thorough examples.
Window.getSelection() - Web APIs
however, attempting to use a javascript string property or method such as length or substr directly on a selection object will result in an
error if it does not have that property or method and may return unexpected results if it does.
Window.localStorage - Web APIs
exceptions security
error the request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example).
Window.releaseEvents() - Web APIs
syntax window.releaseevents(eventtype) eventtype is a combination of the following values: event.abort, event.blur, event.click, event.change, event.dblclick, event.dragddrop, event.
error, event.focus, event.keydown, event.keypress, event.keyup, event.load, event.mousedown, event.mousemove, event.mouseout, event.mouseover, event.mouseup, event.move, event.reset, event.resize, event.select, event.submit, event.unload.
Window.sessionStorage - Web APIs
exceptions security
error the request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example).
Window: unload event - Web APIs
bubbles no cancelable no interface event event handler property onunload it is fired after: beforeunload (cancelable event) pagehide the document is in the following state: all the resources still exist (img, iframe etc.) nothing is visible anymore to the end user ui interactions are ineffective (window.open, alert, confirm, etc.) an
error won't stop the unloading workflow please note that the unload event also follows the document tree: parent frame unload will happen before child frame unload (see example below).
WindowEventHandlers - Web APIs
windoweventhandlers.onmessage
error is an eventhandler representing the code to be called when the message
error event is raised.
encodeURI() - JavaScript
encoding a lone high surrogate throws an uri
error will be thrown if one attempts to encode a surrogate which is not part of a high-low pair, e.g., // high-low pair ok console.log(encodeuri('\ud800\udfff')); // lone high surrogate throws "uri
error: malformed uri sequence" console.log(encodeuri('\ud800')); // lone low surrogate throws "uri
error: malformed uri sequence" console.log(encodeuri('\udfff')); encoding for ipv6 if one wishes to follo...
encodeURIComponent() - JavaScript
'() console.log(encodeuri(set3)); // # console.log(encodeuri(set4)); // abc%20abc%20123 (the space gets encoded as %20) console.log(encodeuricomponent(set1)); // %3b%2c%2f%3f%3a%40%26%3d%2b%24 console.log(encodeuricomponent(set2)); // -_.!~*'() console.log(encodeuricomponent(set3)); // %23 console.log(encodeuricomponent(set4)); // abc%20abc%20123 (the space gets encoded as %20) note that a uri
error will be thrown if one attempts to encode a surrogate which is not part of a high-low pair, e.g., // high-low pair ok console.log(encodeuricomponent('\ud800\udfff')); // lone high surrogate throws "uri
error: malformed uri sequence" console.log(encodeuricomponent('\ud800')); // lone low surrogate throws "uri
error: malformed uri sequence" console.log(encodeuricomponent('\udfff')); use encodeuri...
eval() - JavaScript
function test() { var x = 2, y = 4; console.log(eval('x + y')); // direct call, uses local scope, result is 6 var geval = eval; // equivalent to calling eval in the global scope console.log(geval('x + y')); // indirect call, uses global scope, throws reference
error because `x` is undefined (0, eval)('x + y'); // another example of indirect call } never use eval()!
globalThis - JavaScript
however, this causes csp violations in some settings, so es6-shim uses a check like this, for example: var getglobal = function () { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } throw new
error('unable to locate global object'); }; var globals = getglobal(); if (typeof globals.settimeout !== 'function') { // no settimeout in this environment!
null - JavaScript
it is not defined and has never been initialized: foo; //reference
error: foo is not defined // foo is known to exist now but it has no type or value: var foo = null; foo; //null examples difference between null and undefined when checking for null or undefined, beware of the differences between equality (==) and identity (===) operators, as the former performs type-conversion.
Destructuring assignment - JavaScript
sole.log(a); // 1 console.log(b); // 3 const [c] = f(); console.log(c); // 1 you can also ignore all returned values: [,,] = f(); assigning the rest of an array to a variable when destructuring an array, you can unpack and assign the remaining part of it to a variable using the rest pattern: const [a, ...b] = [1, 2, 3]; console.log(a); // 1 console.log(b); // [2, 3] be aware that a syntax
error will be thrown if a trailing comma is used on the left-hand side with a rest element: const [a, ...b,] = [1, 2, 3]; // syntax
error: rest element may not have a trailing comma // always consider using rest operator as the last element unpacking values from a regular expression match when the regular expression exec() method finds a match, it returns an array containing first the entire match...
Exponentiation (**) - JavaScript
that is, you cannot put a unary operator (+/-/~/!/delete/void/typeof) immediately before the base number; doing so will cause a syntax
error.
Property accessors - JavaScript
const variable = object.property_name; object.property_name = value; const object = {}; object.$1 = 'foo'; console.log(object.$1); // 'foo' object.1 = 'bar'; // syntax
error console.log(object.1); // syntax
error here, the method named createelement is retrieved from document and is called.
in operator - JavaScript
let color1 = new string('green') 'length' in color1 // returns true let color2 = 'coral' // generates an
error (color2 is not a string object) 'length' in color2 using in with deleted or undefined properties if you delete a property with the delete operator, the in operator returns false for that property.
void operator - JavaScript
void function iife() { console.log("executed!"); }(); // output: "executed!" executing the above function without the void keyword will result in an uncaught syntax
error.
function declaration - JavaScript
you can use the function before you declared it: hoisted(); // logs "foo" function hoisted() { console.log('foo'); } note that function expressions are not hoisted: nothoisted(); // type
error: nothoisted is not a function var nothoisted = function() { console.log('bar'); }; examples using function the following code declares a function that returns the total amount of sales, when given the number of units sold of products a, b, and c.
Template literals (Template strings) - JavaScript
s started by "\x", for example \xa9 octal literal escapes started by "\0o" and followed by one or more digits, for example \0o251 this means that a tagged template like the following is problematic, because, per ecmascript grammar, a parser looks for valid unicode escape sequences, but finds malformed syntax: latex`\unicode` // throws in older ecmascript versions (es2016 and earlier) // syntax
error: malformed unicode character escape sequence es2018 revision of illegal escape sequences tagged templates should allow the embedding of languages (for example dsls, or latex), where other escapes sequences are common.
JavaScript
standard objects get to know standard built-in objects array, boolean, date,
error, function, json, math, number, object, regexp, string, map, set, weakmap, weakset, and others.
Authoring MathML - MathML
cons: this may be harder to use: people must learn a syntax, typos in the code may easily lead to parsing or rendering
errors etc the interface is not user-friendly: only code editor without immediate display of the mathematical expression.
<mmultiscripts> - MathML
prescripts are optional and are separated by the empty tag <mprescripts/> (only one <mprescripts /> element is allowed, otherwise you will get an duplicatemprescripts
error in the
error console and "invalid-markup" in your rendering).
<semantics> - MathML
the <semantics> element acts as a container element associating annotations and must have child elements (it will raise an invalid markup
error otherwise).
Guide to streaming audio and video - Web media technologies
for example, because many web sites' mobile-specific content assume that mobile browsers support hls, firefox for android does as well, in order to avoid strange compatibility
errors from occurring due to this assumption being incorrect.
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
sendstatus(201); }); app.post(route + 'sendnotification', function(req, res) { const subscription = req.body.subscription; const payload = req.body.payload; const options = { ttl: req.body.ttl }; settimeout(function() { webpush.sendnotification(subscription, payload, options) .then(function() { res.sendstatus(201); }) .catch(function(
error) { console.log(
error); res.sendstatus(500); }); }, req.body.delay * 1000); }); }; service-worker.js the last file we will look at is the service worker: self.addeventlistener('push', function(event) { const payload = event.data ?
SVG Event Attributes - SVG: Scalable Vector Graphics
attributes animation event attributes onbegin, onend, onrepeat document event attributes onabort, on
error, onresize, onscroll, onunload document element event attributes oncopy, oncut, onpaste global event attributes oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, on
error, onfocus, oninput, oninvalid, onkeydown, onkeypress, onk...
begin - SVG: Scalable Vector Graphics
those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wheel, beforeinput, input, keydown, keyup, compositionstart, compositionupdate, compositionend, load, unload, abort,
error, select, resize, scroll, beginevent, endevent, and repeatevent.
end - SVG: Scalable Vector Graphics
those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wheel, beforeinput, input, keydown, keyup, compositionstart, compositionupdate, compositionend, load, unload, abort,
error, select, resize, scroll, beginevent, endevent, and repeatevent .
requiredFeatures - SVG: Scalable Vector Graphics
//www.w3.org/tr/svg11/feature#basicfilter the browser supports the <filter>, <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femergenode>, <feoffset>, <fetile>, <fefuncr>, <fefuncg>, <fefuncb> and <fefunca> elements http://www.w3.org/tr/svg11/feature#documenteventsattribute the browser supports the onunload, onabort, on
error, onresize, onscroll and onzoom attributes http://www.w3.org/tr/svg11/feature#graphicaleventsattribute the browser supports the onfocusin, onfocusout, onactivate, onclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout and onload attributes http://www.w3.org/tr/svg11/feature#animationeventsattribute the browser supports the onbegin, onend, onrepeat and onload attributes ...
SVG Attribute reference - SVG: Scalable Vector Graphics
tetype, attributename animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes calcmode, values, keytimes, keysplines, from, to, by, autoreverse, accelerate, decelerate animation addition attributes additive, accumulate event attributes animation event attributes onbegin, onend, onrepeat document event attributes onabort, on
error, onresize, onscroll, onunload global event attributes oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, on
error, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, ...
<a> - SVG: Scalable Vector Graphics
ke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes most notably: xlink:title aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<circle> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<ellipse> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<foreignObject> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<g> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<line> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<marker> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<path> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<polygon> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<polyline> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<rect> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<svg> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<symbol> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<text> - SVG: Scalable Vector Graphics
sharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<textPath> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<tspan> - SVG: Scalable Vector Graphics
sharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
<use> - SVG: Scalable Vector Graphics
ke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-
errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan,...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
eet not implemented clipping, masking, and compositing change notes overflow respected on outermost <svg> elements inline in html implementation status unknown interactivity change notes tabindex attribute implemented (bug 778654) bounding-box on pointer-events not implemented (bug 945187) load, abort,
error, and unload instead of svgload, svgabort, svg
error, and svgunload not implemented (bug 620002) only structurally external elements and outermost <svg> element fire load events implementation status unknown resize and scroll instead of svgresize and svgscroll implementation status unknown domactivate removed implementation status unknown focusin and ...
Mixed content - Web security
to make it easier for web developers to find mixed content
errors, all blocked mixed content requests are logged to the security pane of the web console, as seen below: to fix this type of
error, all requests to http content should be removed and replaced with content served over https.
Subresource Integrity - Web security
if the script or stylesheet doesn’t match its associated integrity value, the browser must refuse to execute the script or apply the stylesheet, and must instead return a network
error indicating that fetching of that script or stylesheet failed.
Types of attacks - Web security
the web server reflects the injected script back to the user's browser, such as in an
error message, search result, or any other response that includes data sent to the server as part of the request.