Search completed in 0.94 seconds.
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.
... status 412 precondition
failed examples etag: "33a64df551425fcc55e4d42a148795d9f25f89d4" etag: w/"0815" avoiding mid-air collisions with the help of the etag and the if-match headers, you can detect mid-air edit collisions.
... 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.
... specifications specification title rfc 7232, section 4.2: 412 precondition
failed hypertext transfer protocol (http/1.1): conditional requests ...
RTCInboundRtpStreamStats.packetsFailedDecryption - Web APIs
the packets
faileddecryption property of the rtcinboundrtpstreamstats dictionary indicates the total number of rtp packets which
failed to be decrypted successfully after being received by the local end of the connection during this session.
... syntax var packets
faileddecryption = rtcinboundrtpstreamstats.packets
faileddecryption; value an integer value which indicates how many packets the local end of the rtp connection could not be successfully decrypted.
... specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.packets
faileddecryption' in that specification.
Automatically Handle Failed Asserts in Debug Builds - Archive of obsolete content
as of 2004-12-8, it is now possible to automatically handle
failed asserts in debug builds of mozilla for windows.
...as an example, consider the following
failed assertion: assertion: no document: 'mdocument != nsnull', file d:/cvs-1.11.4/mozilla/content/xul/content/src/nsxulelement.cpp, line 3173 (note that i have my source tree in d:/cvs-1.11.4/mozilla) if you have a dword in hkcu\software\mozilla.org\windbgdlg\ named "d:/cvs-1.11.5/mozilla/content/xul/content/src/nsxulelement.cpp," (with the comma - matches are whole-word only) and value 0x5, the asser...
417 Expectation Failed - HTTP
the http 417 expectation
failed client error response code indicates that the expectation given in the request's expect header could not be met.
... status 417 expectation
failed specifications specification title rfc 7231, section 6.5.14: 417 expectation
failed hypertext transfer protocol (http/1.1): semantics and content ...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
n", "-v"); exit(-1); } /* * validate the options used for generate csr command */ static void validategeneratecsrcommand(const char *progname, const char *dbdir, certname *subject, const char *subjectstr, const char *certreqfilename) { prbool validation
failed = pr_false; if (!subject) { pr_fprintf(pr_stderr, "%s -g -d %s -s: improperly formatted name: \"%s\"\n", progname, dbdir, subjectstr); validation
failed = pr_true; } if (!certreqfilename) { pr_fprintf(pr_stderr, "%s -g -d %s -s %s -r: certificate request file name not found\n", progname, dbdir, subjectstr); ...
...validation
failed = pr_true; } if (validation
failed) { fprintf(stderr, "\nusage: %s %s \n\n", progname, "-g -d <dbdirpath> -s <subject> -r <csr> \n"); exit(-1); } } /* * validate the options used for add cert to db command */ static void validateaddcerttodbcommand(const char *progname, const char *dbdir, const char *nicknamestr, const char *truststr, const char *certfilename, const char *certreqfilename, const char *issuernamestr, const char *serialnumberstr, prbool selfsign) { prbool validation
failed = pr_f...
...alse; if (!nicknamestr) { pr_fprintf(pr_stderr, "%s -a -d %s -n : nick name is missing\n", progname, dbdir); validation
failed = pr_true; } if (!truststr) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t: trust flag is missing\n", progname, dbdir, nicknamestr); validation
failed = pr_true; } if (!certfilename) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t %s -c: certificate file name not found\n", progname, dbdir, nicknamestr, truststr, serialnumberstr, certreqfilename); validation
failed = pr_true; } if (pr_access(certfilename, pr_access_exists) == pr_failure) { if (!certreqfilename) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t %s ...
...And 21 more matches
sample2
err, "%-30s - to enable ascii [optional]\n\n", "-a"); fprintf(stderr, "%-30s - to save certificate to header file as sig verification [optional]\n\n", "-v"); exit(-1); } /* * validate the options used for generate csr command */ static void validategeneratecsrcommand(const char *progname, const char *dbdir, certname *subject, const char *subjectstr, const char *certreqfilename) { prbool validation
failed = pr_false; if (!subject) { pr_fprintf(pr_stderr, "%s -g -d %s -s: improperly formatted name: \"%s\"\n", progname, dbdir, subjectstr); validation
failed = pr_true; } if (!certreqfilename) { pr_fprintf(pr_stderr, "%s -g -d %s -s %s -r: certificate request file name not found\n", progname, dbdir, subjectstr); validation
failed = pr_true; } if (validation
failed) { fprintf(stderr, "\nusage: %s %s \n\n"...
...me, "-g -d <dbdirpath> -s <subject> -r <csr> \n"); exit(-1); } } /* * validate the options used for add cert to db command */ static void validateaddcerttodbcommand(const char *progname, const char *dbdir, const char *nicknamestr, const char *truststr, const char *certfilename, const char *certreqfilename, const char *issuernamestr, const char *serialnumberstr, prbool selfsign) { prbool validation
failed = pr_false; if (!nicknamestr) { pr_fprintf(pr_stderr, "%s -a -d %s -n : nick name is missing\n", progname, dbdir); validation
failed = pr_true; } if (!truststr) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t: trust flag is missing\n", progname, dbdir, nicknamestr); validation
failed = pr_true; } if (!certfilename) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t %s -c: certificate file name not found\n...
...", progname, dbdir, nicknamestr, truststr, serialnumberstr, certreqfilename); validation
failed = pr_true; } if (pr_access(certfilename, pr_access_exists) == pr_failure) { if (!certreqfilename) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t %s -c %s -r: certificate file or certificate request file is not found\n", progname, dbdir, nicknamestr, truststr, certfilename); validation
failed = pr_true; } if (!selfsign && !issuernamestr) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t %s -c %s -r %s -u : issuer name is missing\n", progname, dbdir, nicknamestr, truststr, certfilename, certreqfilename); validation
failed = pr_true; } if (!serialnumberstr) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t %s -c %s -r %s -u %s -m : serial number is missing\n", progname, dbdir, nicknamestr, truststr, certfilename, ce...
...And 16 more matches
Download
this property is reset to null when a
failed download is restarted.
... haspartialdata read only boolean indicates whether, at this time, there is any partially downloaded data that can be used when restarting a
failed or canceled download.
... this property is relevant while the download is in progress, and also if it
failed or has been canceled.
...And 11 more matches
Enc Dec MAC Output Public Key as CSR
pk11symkey * generatesymkey(pk11slotinfo *slot, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; /* generate the symmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_false, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation
failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digest...
...op(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); ...
...for encryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(type, &ivitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt
failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(type, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt
failed : can't create a context\n"); goto cleanup; } cleanup: if (secparam) { secitem_freeitem(secparam, pr_true); } return ctx; } /* * common encryption and decryption code */ secstatu...
...And 11 more matches
sslerr.html
-12278 (unused) ssl_error_wrong_certificate -12277 "client authentication
failed: private key in key database does not correspond to public key in certificate database." ssl_error_bad_cert_domain -12276 "unable to communicate securely with peer: requested domain name does not match the server's certificate." this error code should be returned by the certificate authentication callback function when it detects that the common name in the remote server...
... ssl_error_bad_mac_read -12273 "ssl received a record with an incorrect message authentication code." this usually indicates that the client and server have
failed to come to agreement on the set of keys used to encrypt the application data and to check message integrity.
...this usually indicates that the client and server have
failed to come to agreement on the set of keys used to encrypt the application data and to check message integrity.
...And 11 more matches
Encrypt Decrypt_MAC_Using Token
*/ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation
failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digest...
...op(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : digestop()\n"); } return rv; } /* * finalize macing.
... */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac.
...And 10 more matches
nsIFaviconService
to use this service, use: var faviconservice = components.classes["@mozilla.org/browser/favicon-service;1"] .getservice(components.interfaces.nsifaviconservice); method overview void add
failedfavicon(in nsiuri afaviconuri); void expireallfavicons(); void getfavicondata(in nsiuri afaviconuri, out autf8string amimetype, [optional] out unsigned long adatalen, [array,retval,size_is(adatalen)] out octet adata); obsolete since gecko 22.0 astring getfavicondataasdataurl(in nsiuri afaviconuri); obsolete since gecko 22.0 nsiuri getfaviconforpage(in nsiuri a...
...pageuri); obsolete since gecko 22.0 nsiuri getfaviconimageforpage(in nsiuri apageuri); obsolete since gecko 22.0 nsiuri getfaviconlinkforicon(in nsiuri afaviconuri); boolean is
failedfavicon(in nsiuri afaviconuri); void remove
failedfavicon(in nsiuri afaviconuri); void setandloadfaviconforpage(in nsiuri apageuri, in nsiuri afaviconuri, in boolean aforcereload, in unsigned long afaviconloadtype, [optional] in nsifavicondatacallback acallback); obsolete since gecko 22.0 void setfavicondata(in nsiuri afaviconuri, [const,array,size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, in prtime aexpiration); obsolete since gecko 22.0 void setfavicondatafromdataurl(in nsiuri afaviconuri, in astring adataurl, in ...
... methods add
failedfavicon() this method adds a given favicon's uri to the
failed favicon cache.
...And 10 more matches
Encrypt Decrypt MAC Keys As Session Objects
ecsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation
failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digest...
...op(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); ...
...ryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &ivitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt
failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt
failed : can't create a context\n"); goto cleanup; } cleanup: if (secparam) { secitem_freeitem(secparam, pr_true); } return ctx; } /* * common encryption and decryption code */ s...
...And 8 more matches
Encrypt and decrypt MAC using token
ecsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation
failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digest...
...op(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); ...
...ryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &ivitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt
failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt
failed : can't create a context\n"); goto cleanup; } cleanup: if (secparam) { secitem_freeitem(secparam, pr_true); } return ctx; } /* * common encryption and decryption code */ s...
...And 8 more matches
NSS Sample Code Sample_3_Basic Encryption and MACing
ecsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation
failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digest...
...op(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); ...
...ryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &ivitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt
failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt
failed : can't create a context\n"); goto cleanup; } cleanup: if (secparam) { secitem_freeitem(secparam, pr_true); } return ctx; } /* * common encryption and decryption code */ s...
...And 8 more matches
EncDecMAC using token object - sample 3
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)); return null; } } /* generate the symmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation
failed \n"); } return key; } /* * macinit */ secstatus macinit(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess) { pr_fpri...
...ntf(pr_stderr, "compute mac
failed : digestop()\n"); } return rv; } /* * finalize macing */ secstatus macfinal(pk11context *ctx, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac
failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = macinit(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf,...
...; return secsuccess; } /* * initialize for encryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &ivitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt
failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt
failed : can't create a context\n"); goto cleanup; } cleanup: if (secparam) { secitem_freeitem(secparam, pr_true); } return ctx; } /* * common encryption and decryption code */ secstatus crypt(pk11context *ctx, unsigned char *out, unsigned in...
...And 8 more matches
Setting up your own test automation environment - Learn web development
indelement(by.name('q')).sendkeys('webdriver'); driver.sleep(1000).then(function() { driver.findelement(by.name('q')).sendkeys(webdriver.key.tab); }); driver.findelement(by.name('btnk')).click(); driver.sleep(2000).then(function() { driver.gettitle().then(function(title) { if(title === 'webdriver - google search') { console.log('test passed'); } else { console.log('test
failed'); } driver.quit(); }); }); in terminal, make sure you are inside your project folder, then enter the following command: node google_test you should see an instance of firefox automatically open up!
...q')).sendkeys('webdriver'); driver.sleep(1000).then(function() { driver.findelement(by.name('q')).sendkeys(webdriver.key.tab); }); driver.findelement(by.name('btnk')).click(); driver.sleep(2000).then(function() { driver.gettitle().then(function(title) { if(title === 'webdriver - google search') { console.log('test passed'); } else { console.log('test
failed'); } driver.quit(); }); }); } in terminal, make sure you are inside your project folder, then enter the following command: node google_test_multiple if you are using a mac and do decide to test safari, you might get an error message along the lines of "could not create a session: you must enable the 'allow remote automation' option in safari's develop menu to control s...
... in our google_test.js test for example, we included this block: driver.sleep(2000).then(function() { driver.gettitle().then(function(title) { if(title === 'webdriver - google search') { console.log('test passed'); } else { console.log('test
failed'); } }); }); the sleep() method accepts a value that specifies the time to wait in milliseconds — the method returns a promise that resolves at the end of that time, at which point the code inside the then() executes.
...And 7 more matches
Error codes returned by Mozilla APIs
ns_error_abort (0x80004004) this error indicates that an operation
failed and the caller should abort whatever action is being performed.
... ns_error_file_execution_
failed (0x80520003) an attempt to launch or execute a file
failed because the file is not executable.
... ns_error_file_copy_or_move_
failed (0x80520007) a call to nsifile.copyto() or nsifile.moveto()
failed.
...And 6 more matches
JIT Optimization Outcomes
genericfailure the optimization attempt
failed, and the reason was not recorded.
... notypeinfo optimization
failed because there was no type information associated with an object containing the property.
... unknownproperties optimization
failed because the object containing the property was marked as having unknown properties.
...And 6 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.
... nscomptr<nsicategorymanager> catman; rv = servman->getservicebycontractid(ns_categorymanager_contractid, ns_get_iid(nsicategorymanager), getter_addrefs(catman)); if (ns_
failed(rv)) return rv; there are two service getters on the nsiservicemanager interface: one that takes a cid and another interface that takes a contract id.
...icomponentmanager *acompmgr, nsifile *apath, const char *registrylocation, const char *componenttype, const nsmodulecomponentinfo *info) { nsresult rv; nscomptr<nsiservicemanager> servman = do_queryinterface((nsisupports*)acompmgr, &rv); if (ns_
failed(rv)) return rv; nscomptr<nsicategorymanager> catman; rv = servman->getservicebycontractid(ns_categorymanager_contractid, ns_get_iid(nsicategorymanager), getter_addrefs(catman)); if (ns_
failed(rv)) return rv; char* previous = nsnull; rv = catman->addcategoryentry("xpcom-startup", ...
...And 5 more matches
Working with Multiple Versions of Interfaces
to do this i used the accessibility framework: hwnd gethwnd(nsidomnode *node){ hwnd self = null; nsresult rv; nscomptr<nsiaccessibleretrieval> refp; refp = do_createinstance( "@mozilla.org/accessibleretrieval;1", &rv); if (ns_
failed(rv)){ return self; } //line 6.
... nscomptr<nsiaccessible> accnode; rv = refp->getaccessiblefor(node, getter_addrefs(accnode)); if(ns_
failed(rv)){ return self; } void *wh = null; nscomptr<nsiaccessibledocument> accdocnode; accdocnode = do_queryinterface(accnode, &rv); if(ns_
failed(rv)){ return self; } rv = accdocnode->getwindowhandle(&wh); if(ns_succeeded(rv)){ self = static_cast<hwnd>(wh); } return self; } this approach worked, as is, for versions as early as firefox 1.5.
... the optimist's solution the first thing we do is replace line 6 above by our plan b: if (ns_
failed(rv)){ return gethwndb(node); } //new line 6.
...And 5 more matches
Index - Web APIs
1003 document: pointerlockerror event document, event, reference, web, pointerlockerror the pointerlockerror event is fired when locking the pointer
failed (for technical reasons or because the permission was denied).
... 1194 element: error event audio, dom, error handling, errors, event, media, reference, ui, ui events, uievent, video, web, events the error event is fired on an element object when a resource
failed to load, or can't be used.
... 1350 filereader: error event api, error, event, filereader, progressevent, reference, web, onerror the error event is fired when the read
failed due to an error (for example, because the file was not found or not readable).
...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 don't care if this
failed!
... } 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.
...And 4 more matches
Examples
let lastpromise = newpromise.then(function onfulfill(){ }) .catch(function onreject(arejectreason) { console.warn('newpromise
failed with reason: ', arejectreason); }); using a promise returned by a function (verbose) this example uses a verbose syntax, showing all the involved promises.
... console.log(filescontent); }, function onfail() { console.error("
failed to load all files"); } ); see also the ask.m.o topic: doing multiple promises in function in pareallel, how return when last done?
... components.utils.import("resource://gre/modules/promise.jsm"); var mypromise = myuserdefinedpromise(); mypromise.then( function(asuccessreason) { alert('mypromise was succesful and reason was = "' + asuccessreason + '"'); }, function(arejectreason) { alert('mypromise
failed for reason = "' + uneval(arejectreason) + '"'); } ); function myuserdefinedpromise() { try { //var myvariscommented = 'hi'; // i commented this out s oit is undefined, this will cause rejected alert(myvariscommented); return promise.resolve('yay success'); // this makes the success function trigger with asuccessreason being 'yay success' but because i commented out the var 2 lin...
...And 4 more matches
nsISmsRequestManager
illa.org/sms/smsrequestmanager;1"] .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 notifygetsms
failed(in long arequestid, in long aerror); 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 notifymarkmessageread
failed(in long arequestid, in long aerror); void notifynomessageinlist(in long arequestid); void notifyread...
...messagelist
failed(in long arequestid, in long aerror); void notifysmsdeleted(in long arequestid, in bool adeleted); void notifysmsdelete
failed(in long arequestid, in long aerror); void notifysmssend
failed(in long arequestid, in long aerror); void notifysmssent(in long arequestid, in nsidommozsmsmessage amessage); constants all sms related errors that could apply to smsrequest objects.
... notifygetsms
failed() void notifygetsms
failed( in long arequestid, in long aerror ); parameters arequestid a number representing the id of the request.
...And 4 more matches
RTCPeerConnection - Web APIs
"
failed" the ice candidate has checked all candidates pairs against one another and has
failed to find compatible matches for all components of the connection.
... "disconnected" checks to ensure that components are still connected
failed for at least one component of the rtcpeerconnection.
... this is a less stringent test than "
failed" and may trigger intermittently and resolve just as spontaneously on less reliable networks, or during temporary disconnections.
...And 4 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
netscape.cfg/autoconfig
failed.
... error: getldapattibutes
failed: [exception...
... // getldapattributes("ldap2.int-evry.fr","ou=people,dc=int-evry,dc=fr","uid=" + env_user,"uid,cn,mail,labeleduri"); // close the try, and call the catch() } catch(e) {displayerror("lockedpref", e);} if ldap call are uncommented in the preference file above, then i get a popup with: netscape.cfg/autoconfig
failed.
...And 3 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
a workaround to this would be to detect if initinstall has
failed, and then invoke it again without the "=" string.
... here is an example: var plid = "myplugin.plug/version=6.5"; err = initinstall(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 = addfile("@myplugin.com/myplugin,version=2.5.0.0", "2.5.0.0", plugin_file, pluginsfolder, null); if (err != 0) { //alert("installation of myplugin plug-in
failed.
...And 3 more matches
JS::CompileOptions
returns false if it
failed to duplicate owning properties.
...returns false if it
failed to duplicate.
...returns false if it
failed to duplicate.
...And 3 more matches
Creating the Component Code
le::registerself(nsicomponentmanager *acompmgr, nsifile* apath, const char* registrylocation, const char* componenttype) { printf("hello mozilla registration!\n\n"); nsicomponentregistrar* compreg = nsnull; nsresult rv = acompmgr->queryinterface(kicomponentregistrariid,(void**)& compreg); if (ns_
failed(rv)) return rv; rv = compreg->registerfactorylocation(ksamplecid, "sample class", nsnull, apath, registrylocation, componenttype); compreg->release(); return rv; } unr...
... 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 implements all the necessary interfaces looks like this.
...; return 0; } return mrefcnt; } 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; } ns_imethodimp samplefactory::lockfactory(prbool lock) { return ns_error_not_implemented; } // module implementation class samplemodule : public nsimodule { public: samplemodule(); virtual ~samplemodule(); // nsisupports methods: ns_imethod queryinterface(const nsiid & uuid, void * *result); ns_imethod_(...
...And 3 more matches
Event reference
most common categories resource events event name fired when error a resource
failed to load.
... error progression has
failed.
... error uievent dom l3 a resource
failed to load.
...And 3 more matches
Network Error Logging - HTTP
this experimental header allows web sites and applications to opt-in to receive reports about
failed (and, if desired, successful) network fetches from supporting browsers.
... failure_fraction floating point value between 0 and 1 which specifies the proportion of
failed network requests to report.
... defaults to 1, so that all
failed network requests will be reported if the key is not present in the json payload.
...And 3 more matches
InstallListener
method overview void onnewinstall(in addoninstall install) void ondownloadstarted(in addoninstall install) void ondownloadprogress(in addoninstall install) void ondownloadended(in addoninstall install) void ondownloadcancelled(in addoninstall install) void ondownload
failed(in addoninstall install) void oninstallstarted(in addoninstall install) void oninstallended(in addoninstall install, in addon addon) void oninstallcancelled(in addoninstall install) void oninstall
failed(in addoninstall install) void onexternalinstall(in addon install, in addon existingaddon, in boolean needsrestart) methods onnewinstall() call...
... void ondownloadcancelled( in addoninstall install ) parameters install the addoninstall representing the install ondownload
failed() called if there is some error downloading the add-on.
... void ondownload
failed( in addoninstall install ) parameters install the addoninstall representing the install oninstallstarted() called when installation of an add-on begins.
...And 2 more matches
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 || server1->init()) { cout << "server1 could not be created" << endl; rv = 1; goto done; } // generate encryption and mac keys.
... rv = server1->generatekeys(); if (rv) { cout << "generatekeys
failed" << endl; goto done; } // now that everything is ready, start server1.
... { 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 and get back the // wrapped key values rv = server1->exportkeys(pubkeydata, &wrappedenckey, &wrappedmackey); if (rv) { cout << "exportkeys
failed" << endl; goto trans_done; } // print - for information cout << "wrapped encryption key" << endl; printbuffer(wrappedenckey->data, wrappedenckey->len); cou...
...And 2 more matches
NSS Sample Code sample3
* this code uses the simplest of the init functions, which does not * require a nss database to exist */ nss_nodb_init("."); /* get a slot to use for the crypto operations */ slot = pk11_getinternalkeyslot(); if (!slot) { cout << "getinternalkeyslot
failed" << endl; status = 1; goto done; } /* * part 1 - simple hashing */ cout << "part 1 -- simple hashing" << endl; /* initialize data */ memset(data, 0xbc, sizeof data); /* create a context for hashing (digesting) */ context = pk11_createdigestcontext(sec_oid_md5); if (!context) { cout << "createdigestcontext
failed" << endl; goto done; } s = pk11_digestbegin(cont...
...ext); if (s != secsuccess) { cout << "digestbegin
failed" << endl; goto done; } s = pk11_digestop(context, data, sizeof data); if (s != secsuccess) { cout << "digestupdate
failed" << endl; goto done; } s = pk11_digestfinal(context, digest, &len, sizeof digest); if (s != secsuccess) { cout << "digestfinal
failed" << endl; goto done; } /* print digest */ printdigest(digest, len); pk11_destroycontext(context, pr_true); context = 0; /* * part 2 - hashing with included secret key */ cout << "part 2 -- hashing with included secret key" << endl; /* initialize data */ memset(data, 0xbc, sizeof data); /* create a key */ key = pk11_keygen(slot, ckm_generic_secret_key_gen, 0, 128, 0); if (!key) { cout << "create key
failed" << endl; goto done; } cout << (voi...
... for crypto context */ /* note: params must be provided, but may be empty */ secitem noparams; noparams.type = sibuffer; noparams.data = 0; noparams.len = 0; /* create context using the same slot as the key */ // context = pk11_createdigestcontext(sec_oid_md5); context = pk11_createcontextbysymkey(ckm_md5, cka_digest, key, &noparams); if (!context) { cout << "createdigestcontext
failed" << endl; goto done; } s = pk11_digestbegin(context); if (s != secsuccess) { cout << "digestbegin
failed" << endl; goto done; } s = pk11_digestkey(context, key); if (s != secsuccess) { cout << "digestkey
failed" << endl; goto done; } s = pk11_digestop(context, data, sizeof data); if (s != secsuccess) { cout << "digestupdate
failed" << endl; goto done; } s = pk11_digestfinal(cont...
...And 2 more matches
JIT Optimization Strategies
an outcome is either success or a reason why the strategy
failed to apply.
... inline caches are an order of magnitude slower than the other optimization strategies, and are an indication that the type inference engine has
failed to collect enough information to guide the optimization process.
... inline caches are an order of magnitude slower than the other optimization strategies, and are an indication that the type inference engine has
failed to collect enough information to guide the optimization process.
...And 2 more matches
nsIDownloadManager
cancleanup boolean whether or not there are downloads that can be cleaned up (removed) that is downloads that have completed, have
failed or have been canceled.
... download_
failed 2 the download
failed due to error.
... cleanup() removes completed,
failed, and canceled downloads from the list.
...And 2 more matches
WebIDL bindings
e c++ function declarations on the implementation of myinterface: already_addrefed<mycallback> getfoo(); void setfoo(mycallback&); already_addrefed<mycallback> getbar(); void setbar(mycallback*); a consumer of mycallback would be able to use it like this: void someclass::dosomethingwithcallback(mycallback& acallback) { errorresult rv; int32_t number = acallback.getsomenumber(rv); if (rv.
failed()) { // the error has already been reported to the js console; you can handle // things however you want here.
... acallback.setsomenumber(2*number, rv, erethrowexceptions); if (rv.
failed()) { // the exception is now stored on rv.
...terface class: already_addrefed<mycallback> getfoo(); void setfoo(mycallback&); already_addrefed<mycallback> getbar(); void setbar(mycallback*); a consumer of mycallback would be able to use it like this: void someclass::dosomethingwithcallback(mycallback& acallback, myinterface& ainterfaceinstance) { errorresult rv; int32_t number = acallback.call(ainterfaceinstance, false, rv); if (rv.
failed()) { // the error has already been reported to the js console; you can handle // things however you want here.
...And 2 more matches
DOMException - Web APIs
(legacy code value: 25 and legacy constant name: data_clone_err) encodingerror the encoding or decoding operation
failed (no legacy code value and constant name).
... notreadableerror the input/output read operation
failed (no legacy code value and constant name).
... unknownerror the operation
failed for an unknown transient reason (e.g.
...And 2 more matches
WebGL best practices - Web APIs
instead of: function compileonce(gl, shader) { if (shader.compiled) return; gl.compileshader(shader); shader.compiled = true; } for (const [vs, fs, prog] of programs) { compileonce(gl, vs); compileonce(gl, fs); gl.linkprogram(prog); if (!gl.getprogramparameter(prog, gl.link_status)) { console.error('link
failed: ' + gl.getprograminfolog(prog)); console.error('vs info-log: ' + gl.getshaderinfolog(vs)); console.error('fs info-log: ' + gl.getshaderinfolog(fs)); } } consider: function compileonce(gl, shader) { if (shader.compiled) return; gl.compileshader(shader); shader.compiled = true; } for (const [vs, fs, prog] of programs) { compileonce(gl, vs); compileonce(gl, fs); } for (const ...
...[vs, fs, prog] of programs) { gl.linkprogram(prog); } for (const [vs, fs, prog] of programs) { if (!gl.getprogramparameter(prog, gl.link_status)) { console.error('link
failed: ' + gl.getprograminfolog(prog)); console.error('vs info-log: ' + gl.getshaderinfolog(vs)); console.error('fs info-log: ' + gl.getshaderinfolog(fs)); } } khr_parallel_shader_compile for non-blocking compile/link status while we've described a pattern to allow browsers to compile and link in parallel, normally checking compile_status or link_status blocks until the compile or link completes.
... instead of: gl.compileshader(vs); if (!gl.getshaderparameter(vs, gl.compile_status)) { console.error('vs compile
failed: ' + gl.getshaderinfolog(vs)); } gl.compileshader(fs); if (!gl.getshaderparameter(fs, gl.compile_status)) { console.error('fs compile
failed: ' + gl.getshaderinfolog(fs)); } gl.linkprogram(prog); if (!gl.getprogramparameter(vs, gl.link_status)) { console.error('link
failed: ' + gl.getprograminfolog(prog)); } consider: gl.compileshader(vs); gl.compileshader(fs); gl.linkprogram(prog); if (...
...And 2 more matches
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
const {cc,ci} = require("chrome"); function createtcperrorfrom
failedxhr(xhr) { let status = xhr.channel.queryinterface(ci.nsirequest).status; let errtype; if ((status & 0xff0000) === 0x5a0000) { // security module const nsinsserrorsservice = ci.nsinsserrorsservice; let nsserrorsservice = cc['@mozilla.org/nss_errors_service;1'].getservice(nsinsserrorsservice); let errorclass; // geterrorclass will throw a generic ns_error_failure if the erro...
...d_version, ssl(9) errname = 'securityunsupportedtlsversionerror'; break; case 12: // ssl_error_bad_cert_domain, ssl(12) errname = 'securitycertificatedomainmismatcherror'; break; default: errname = 'securityerror'; break; } } } else { errtype = 'network'; switch (status) { // connect to host:port
failed case 0x804b000c: // ns_error_connection_refused, network(13) errname = 'connectionrefusederror'; break; // network timeout error case 0x804b000e: // ns_error_net_timeout, network(14) errname = 'networktimeouterror'; break; // hostname lookup
failed case 0x804b001e: // ns_error_unknown_host, network(30) errname = 'domainnotfound...
... let error = cc["@mozilla.org/dom-error;1"].createinstance(ci.nsidomdomerror); error.wrappedjsobject.init(errname); return error; // xxx: errtype goes unused } function dumpsecurityinfo(xhr, error) { let channel = xhr.channel; try { dump("connection status:\n"); if (!error) { dump("\tsucceeded\n"); } else { dump("\t
failed: " + error.name + "\n"); } let secinfo = channel.securityinfo; // print general connection security state dump("security information:\n"); if (secinfo instanceof ci.nsitransportsecurityinfo) { secinfo.queryinterface(ci.nsitransportsecurityinfo); dump("\tsecurity state of connection: "); // check security state flags if ((secinfo.securitystate & ci.
...And 2 more matches
Index - Archive of obsolete content
374 automatically handle
failed asserts in debug builds as of 2004-12-8, it is now possible to automatically handle
failed asserts in debug builds of mozilla for windows.
...for this we have to first create four icons, one for each tinderbox state (none, success, test
failed, and busted), then create a set of css rules that displays the icon corresponding to the current tinderbox state: 398 tinderbox add-ons, extensions tinderbox is a web tool for tracking the status of the mozilla source code.
...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??!!
... 629 running windows debug builds downloaded from tinderbox if you run the windows debug builds you will often get "this application has
failed to start because the application configuration is incorrect..." this is because the debug builds need the msvc80 crt debug dlls.
Table Layout Regression Tests - Archive of obsolete content
execute the baseline test shutdown the layoutdebugger execute mozilla -layoutdebug - p foo >selftest.txt execute the verify test make a note which tests have
failed grep '
failed' selftest.txt (these are false positives, quite frequently they indicate reflow problems, pages showing differently when loaded from cache) make your changes to the source, recompile.
... execute mozilla -layoutdebug - p foo >outputfile.txt execute the verify test make a note which tests have
failed grep '
failed' outputfile.txt check how many tests have
failed and analyze your results: if the regression tests have
failed at the same place as the previous diagnosed false positives => ignore try to figure out what the other regressions are: are they improving the picture or are they regressions?
...right: null bottom: null left: null top: null right: null bottom: null 1[0x1]enum 0|1 1 [none]|left: auto top: auto right: auto bottom: auto auto 0[0x0]tw null auto 0[0x0]tw null 0 auto |0 0 0 normal normal 0[0x0]tw normal |0 11 1,000000 0 0 0 0 0 0 0 0 0 0 0 [none]|0 0 0 -1 1 |0 0 0 null comparison for file:///e:/moz_src/mozilla/layout/html/tests/table/core/baseline/standards1.rgd
failed.
... the first regression test has
failed and it is marked so.
Overview of Mozilla embedding APIs
webbrowser = do_createinstance(ns_webbrowser_contractid, &rv); if (ns_
failed(rv)) return rv; // give the webbrowser a pointer to the embedding component which // implements the callback interfaces.
... rv = webbrowser->setcontainerwindow((nsiwebbrowserchrome*)this); if (ns_
failed(rv)) return rv; basewindow = do_queryinterface(webbrowser); // initialize the webbrowser with a native parent window // (ie.
... if (ns_
failed(rv)) return rv; // create the child window for the webbrowser.
... rv = basewindow->create(); if (ns_
failed(rv)) return rv; // at this point webbrowser contains the new initialized instance // of the nswebbrowser component...
OS.File.Error
cross-platform attributes operation the human-readable name of the
failed operation.
... becauseexists true if the operation
failed because a file or directory exists, false otherwise.
... becausenosuchfile true if the operation
failed because a file or directory does not exist, false otherwise.
... becauseclosed true if the operation
failed because a file or directory is closed, false otherwise.
Initialize NSS database - sample 2
(newpwfile) { newpwdata.source = pw_fromfile; newpwdata.data = null; } else { newpwdata.source = pw_none; newpwdata.data = null; } if (pk11_needuserinit(slot)) { newpw = initslotpassword(slot, pr_false, &pwdata); rv = pk11_initpin(slot, (char*)null, newpw); if (rv == secsuccess) { pr_fprintf(pr_stderr, "pk11_initpin
failed.\n"); return secfailure; } } else { for (;;) { oldpw = getmodulepassword(slot, pr_false, &pwdata); if (pk11_checkuserpassword(slot, oldpw) != secsuccess) { if (pwdata.source == pw_none) { pr_fprintf(pr_stderr, "invalid password.
... port_memset(oldpw, 0, pl_strlen(oldpw)); port_free(oldpw); return secfailure; } } else { break; } port_free(oldpw); } newpw = initslotpassword(slot, pr_false, &newpwdata); if (pk11_changepw(slot, oldpw, newpw) != secsuccess) { pr_fprintf(pr_stderr, "
failed to change password.\n"); return secfailure; } port_memset(oldpw, 0, pl_strlen(oldpw)); port_free(oldpw); pr_fprintf(pr_stdout, "password changed successfully.\n"); } port_memset(newpw, 0, pl_strlen(newpw)); port_free(newpw); return secsuccess; } /* * this example illustrates initialization of the nss database.
... = strdup(optstate->value); break; default: usage(progname); break; } } pl_destroyoptstate(optstate); if (!dbdir) usage(progname); pr_init(pr_user_thread, pr_priority_normal, 0); /* create the database */ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initialize
failed"); pr_cleanup(); exit(rv); } if (pl_strcmp(slotname, "internal") == 0) slot = pk11_getinternalkeyslot(); /* if creating new database, initialize the password.
... */ rv = changepw(slot, plainpass, 0, pwfile, 0); if (rv != secsuccess) { pr_fprintf(pr_stderr, "
failed to change password\n"); } if (slot) { pk11_freeslot(slot); } rvshutdown = nss_shutdown(); if (rvshutdown != secsuccess) { pr_fprintf(pr_stderr, "
failed : nss_shutdown()\n"); rv = secfailure; } pr_cleanup(); return rv; } ...
nsILocalFile
nsresult loaddll(nsilocalfile *alocalfile) { prlibrary *dll; nsresult rv = alocalfile->load(&dll); if (ns_
failed(rv)) return rv; // do something with the library now that it is open...
... nsresult readlocalfile(nsilocalfile *alocalfile) { file *fp; nsresult rv = alocalfile->openansifiledesc("r", &fp); if (ns_
failed(rv)) return rv; char buf[512]; size_t n; while ((n = fread(buf, sizeof(buf), 1, fp)) > 0) { // do something with n-byte block of data from file...
...returns a null pointer if the open
failed.
... nsresult readlocalfile(nsilocalfile *alocalfile) { prfiledesc *fd; nsresult rv = alocalfile->opennsprfiledesc(pr_rdonly, 0, &fd); if (ns_
failed(rv)) return rv; char buf[512]; print32 n; while ((n = pr_read(fd, buf, sizeof(buf))) > 0) { // do something with n-byte block of data from file...
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.
... if the update is not in the "
failed" state, this value is zero.
..."download-
failed" the update
failed to be downloaded.
... "
failed" installing the update
failed.
Troubleshooting XPCOM components registration
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.
...set nspr_log_modules=nsnativemoduleloader:5 set nspr_log_file=c:\path\to\logfile "c:\program files\mozilla firefox\firefox.exe" examining this log for warning and errors may provide valuable clues why the component
failed to load.
... you can also use the profiling feature of dependency walker to view
failed module loads while running your application.
...you will see any modules that
failed to load in the module list.
nsIMsgCloudFileProvider
autherr 0x8055001e returned when authorizing has
failed.
... uploaderr 0x8055311a returned when uploading has
failed for an unknown reason.
... uploadwouldexceedquota 0x8055311b returned when uploading has
failed because the user has exceeded their storage quota.
... uploadexceedsfilelimit 0x8055311c returned when uploading has
failed because the file being uploaded is larger than the file size limit.
RTCPeerConnection.connectionState - Web APIs
constant description "new" at least one of the connection's ice transports (rtcicetransports or rtcdtlstransports) are in the "new" state, and none of them are in one of the following states: "connecting", "checking", "
failed", or "disconnected", or all of the connection's transports are in the "closed" state.
... "connecting" one or more of the ice transports are currently in the process of establishing a connection; that is, their rtciceconnectionstate is either "checking" or "connected", and no transports are in the "
failed" state.
... "disconnected" at least one of the ice transports for the connection is in the "disconnected" state and none of the other transports are in the state "
failed", "connecting", or "checking".
... "
failed" one or more of the ice transports on the connection is in the "
failed" state.
HTTP Index - HTTP
there are a couple of reasons why preflighting might fail: 27 reason: cors request did not succeed cors, corsdidnotsucceed, cross-origin, error, http, https, messages, reasons, security, console, troubleshooting the http request which makes use of cors
failed because the http connection
failed at either the network or protocol level.
...if the resource has been modified after the given date, the response will be a 412 (precondition
failed) error.
... 247 412 precondition
failed error, http, reference, status code the hypertext transfer protocol (http) 412 precondition
failed client error response code indicates that access to the target resource has been denied.
... 252 417 expectation
failed client error, http, http status code, reference, status code the http 417 expectation
failed client error response code indicates that the expectation given in the request's expect header could not be met.
passwords - Archive of obsolete content
onerror function the callback function that is called if the function
failed.
... onerror function the callback function that is called if the function
failed.
... onerror function the callback function that is called if the function
failed.
Enabling the behavior - updating the status bar panel - Archive of obsolete content
function updatetinderboxstatus() { var icon = document.getelementbyid('tinderbox-status'); if (gxmlhttprequest.responsetext.match("ee0000")) icon.setattribute("status", "busted"); else if (gxmlhttprequest.responsetext.match("ffaa00")) icon.setattribute("status", "test
failed"); else if (gxmlhttprequest.responsetext.match("11dd11")) icon.setattribute("status", "success"); else icon.setattribute("status", ""); } updatetinderboxstatus() retrieves a reference to the statusbarpanel element then searches through the retrieved html document (stored in the responsetext property of the xmlhttprequest instance) for one of several color references.
... the color red (represented by the rgb code ee0000) means a tinderbox client
failed to build mozilla.
... the color orange ("ffaaoo") means a client successfully built mozilla, but the build
failed tests.
Monitoring downloads - Archive of obsolete content
items values " + "(?1, ?2, ?3, 0, 0.0, 0)"); statement.bindstringparameter(0, adownload.source.spec); statement.bindint64parameter(1, adownload.size); statement.bindint64parameter(2, adownload.starttime); statement.execute(); statement.reset(); dbconn.close(); break; // record the completion (whether
failed or successful) of the download case components.interfaces.nsidownloadmanager.download_finished: case components.interfaces.nsidownloadmanager.download_
failed: case components.interfaces.nsidownloadmanager.download_canceled: this.logtransfercompleted(adownload); break; } }, we're interested in four states.
... if the download's state indicates that the download is finished, canceled, or
failed, we call our logtransfercompleted routine to update the log to indicate that state change.
...ell); var status = statement.getint32(5); var style = "color:black"; cell = document.createelement('listcell'); var statusstr; switch(status) { case 0: statusstr = "downloading"; break; case 1: statusstr = "complete"; style = "color:green"; break; case 2: statusstr = "
failed"; style = "color:red"; break; case 3: statusstr = "canceled"; style = "color:purple"; break; case 4: statusstr = "paused"; style = "color:blue"; break; case 5: statusstr = "queued"; style = "color:teal"; break; case 6: statusstr = ...
Tamarin Build System Documentation - Archive of obsolete content
the page is divided into the phase table at the top and the waterfall table below the phase table shows all phases at the top of the page, each slave is shown as a box with a red,green, or yellow color: red means
failed, green passed, and yellow has warnings.
... most recent phase run or click on an individual box to display the test result below the phase table the waterfall displays each buildstep and result the left side contains the time column and the user/revision link to represent the revision triggering a build, mouse over the user to see the revision and submission notes each buildstep run on a slave is a box with color indicating status, red is
failed, green passed, yellow has warnings click the stdio link to see the output click on the build yellow box at the bottom of a set of buildsteps to see the result of all of the buildsteps for a build and the time each buildstep took scroll down to see previous builds triggered at the bottom of the page click on the [next page] link to display more previous builds what are the goals of the build ...
... the list of smoke tests are located in the tamarin-repository, test/run-smokes.txt, assume the start directory is test format is cd testdir; command to run test above the test should be a # comment describing why the test in the smokes, when test
failed, possibly a bugzilla bug the tests can be run by following the above instructions for running buildbot scripts locally and executing the all/run-smoke-tests.sh as a rule any test failure should be immediately added to the top of the smoke test list so the list is prioritized how to exclude tests from acceptance or mark them as known failures?
Install script template - Archive of obsolete content
* you should not stop the install process because the function
failed, * you still have a chance to install the plugin for the already * installed gecko browsers.
... * you should not stop the install process because the function
failed, * you still have a chance to install the plugin for the already * installed gecko browsers.
... * you should not stop the install process because the function
failed.
Return Codes - Archive of obsolete content
patch_bad_checksum_result -222 the checksum of the patched file
failed.
... uninstall_
failed -223 an error occurred while uninstalling a package.
... package_folder_not_set -224 install folder not set in installation script extraction_
failed -225 extraction of xpi file
failed.
Using LDAP XPCOM with XULRunner - Archive of obsolete content
ll_suffix, #endif //ns_unix nsnull }; // component.dll on windows, libcomponent.dll on linux static char krealcomponent[] = 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 don't care if this
failed!
... } 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-11-17 - Archive of obsolete content
the test program
failed to compile or link.
...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.
...paul reed announced that: there was a power outage at his office and the machines, which are responsible for running autoconf (configure.in -> configure), located in his office
failed to boot up after power was restored.
Application cache implementation overview
falling back on a resource load failure when a resource previously matching a fallback namespace
failed to load from the network, we perform fallback to the previously remembered fallback entry.
... if the manifest load
failed, onerror event is invoked and the update 'finishes'.
... when the manifest has changed, the update is simply rescheduled, with limit of up to 3 retries (then it fails.) when load of the manifest has
failed or redirected, the original update invokes onerror and 'finishes'.
HTML parser threading
otherwise it has
failed.
...(nshtml5treeopexecutor::runflushloop is on the call stack already in this case and will loop around to start flushing the ops right away.) if there's only one speculation or the speculation
failed, it's necessary to bother the parser thread.
...if the speculation
failed, the first buffer corresponding to the starting point of the speculation gets its start index restored to the index stored on the speculation object.
How Mozilla determines MIME Types
the list in edit/preferences/helper applications) if that
failed, a list of "extra" mime types is searched for an extension match.
... if that also
failed, the list of loaded plugins is checked for a plugin that can handle this extension, and is asked for the mime type if no plugin is registered, the ext-to-type-mapping xpcom category is searched for the extension.
... if this also
failed, the extras are searched again, and will supply the extension-list and a description of the mime type.
Assert.jsm
ual, expected, message); undefined throws(block, expected, message); promise rejects(promise, expected, message); undefined greater(lhs, rhs, message); undefined greaterorequal(lhs, rhs, message); undefined less(lhs, rhs, message); undefined lessorequal(lhs, rhs, message); undefined setreporter(reporterfunc); undefined report(
failed, actual, expected, message, operator); constructor creates a new assert object.
... arguments passed in to this function are: err an error object when the assertion
failed or null when it passed message message describing the assertion stack stack trace of the assertion function.
... undefined report(
failed, actual, expected, message, operator ); parameters
failed indicates if the assertion
failed or not actual the result of evaluating the assertion expected expected result from the test author message short explanation of the expected result operator operation qualifier used by the assertion method (ex: '==') examples custom reporter example components.utils.import("resour...
Downloads.jsm
example (using task.jsm): try { yield downloads.fetch(sourceuri, targetfile); } catch (ex if ex instanceof downloads.error && ex.becausetarget
failed) { console.log("unable to write to the target file, ignoring the error."); } methods createdownload() creates a new download object.
... promise can be rejected with downloaderror if the download
failed.
... the start() method can be used to restart a
failed download.
Interfacing with the Add-on Repository
handling
failed requests the callback object must have a search
failed() method; this gets called when a repository search fails to execute.
...for example: search
failed: function() { this.shownotification("i have no recommendations for you right now!", "oh noes!", null); }, here, we call a shownotification() method with some parameters that we'll look at shortly when we get to our shownotification() method below.
... 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) { popupnotification...
OS.File for the main thread
"newname.txt", {nooverwrite:true}); here's a working example which renames test.txt to testrenamed.txt if the file is located in directory c:\jean\ var promise = os.file.move(os.path.join('c:', 'jean', 'test.txt'), os.path.join('c:', 'jean', 'testrenamed.txt')); promise.then( function() { console.log('rename successful') }, function(arejectreason) { console.log('rename
failed, arejectreason = ', arejectreason) } ) the nooverwrite true is important, as default is false which means if a file in the directory exists already with the same name it will no longer be there after this "rename" operation, which is a "move".
....join(os.constants.path.desktopdir, 'savedimage.png'); var promise = os.file.writeatomic(writepath, new uint8array(r.result), { tmppath: writepath + '.tmp' }); promise.then( function(aval) { console.log('successfully saved image to disk'); }, function(areason) { console.log('writeatomic
failed for reason:', areason); } ); }; r.readasarraybuffer(b); }, 'image/png'); }; //var path = os.path.tofileuri(os.path.join(os.contants.path.desktopdir, 'my.png')); //do it like this for images on disk var path = 'https://mozorg.cdn.mozilla.net/media/img/firefox/channel/toggler-beta.png?2013-06'; //do like this for images online img.src = path; exampl...
... maxattempts used to limit the amount of tries after a
failed file creation.
Running NSPR tests
sprintf
failed ...
... what if some of the tests crashed or reported
failed as the results?
... it doesn't necessarily mean the test suite
failed because some of the test programs are known to fail.
NSS Sample Code Sample_2_Initialization of NSS
port_memset(oldpw, 0, pl_strlen(oldpw)); port_free(oldpw); return secfailure; } } else { break; } port_free(oldpw); } newpw = initslotpassword(slot, pr_false, &newpwdata); if (pk11_changepw(slot, oldpw, newpw) != secsuccess) { pr_fprintf(pr_stderr, "
failed to change password.\n"); return secfailure; } port_memset(oldpw, 0, pl_strlen(oldpw)); port_free(oldpw); pr_fprintf(pr_stdout, "password changed successfully.\n"); } port_memset(newpw, 0, pl_strlen(newpw)); port_free(newpw); return secsuccess; } /* * this example illustrates initialization of the nss database.
... = strdup(optstate->value); break; default: usage(progname); break; } } pl_destroyoptstate(optstate); if (!dbdir) usage(progname); pr_init(pr_user_thread, pr_priority_normal, 0); /* create the database */ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initialize
failed"); pr_cleanup(); exit(rv); } if (pl_strcmp(slotname, "internal") == 0) slot = pk11_getinternalkeyslot(); /* if creating new database, initialize the password.
... */ rv = changepw(slot, plainpass, 0, pwfile, 0); if (rv != secsuccess) { pr_fprintf(pr_stderr, "
failed to change password\n"); } if (slot) { pk11_freeslot(slot); } rvshutdown = nss_shutdown(); if (rvshutdown != secsuccess) { pr_fprintf(pr_stderr, "
failed : nss_shutdown()\n"); rv = secfailure; } pr_cleanup(); return rv; } </plainpasswc></plainpasswc></dbdirpath></passwdffile></plainpasswc></dbdirpath></pk11func.h></nss.h></prprf.h></plgetopt.h></prthread.h> ...
NSS Sample Code Utilities_1
k11_gettokenname(slot)); return getpassword(stdin, stdout, prompt, checkpassword); case pw_fromfile: pw = filepasswd(slot, retry, pwdata->data); pwdata->source = pw_plaintext; pwdata->data = pl_strdup(pw); return pw; case pw_plaintext: return pl_strdup(pwdata->data); default: break; } pr_fprintf(pr_stderr, "password check
failed: no password found.\n"); return null; } /* * generaterandom */ secstatus generaterandom(unsigned char *rbuf, int rsize) { char meter[] = { "\r| |" }; int fd, count; int c; secstatus rv = secsuccess; cc_t orig_cc_min; cc_t orig_cc_time; tcflag_t ...
...way it was */ tio.c_lflag = orig_lflag; tio.c_cc[vmin] = orig_cc_min; tio.c_cc[vtime] = orig_cc_time; tcsetattr(fd, tcsaflush, &tio); return rv; } /* * seedfromnoisefile */ secstatus seedfromnoisefile(const char *noisefilename) { char buf[2048]; prfiledesc *fd; print32 count; fd = pr_open(noisefilename, pr_rdonly, 0); if (!fd) { fprintf(stderr, "
failed to open noise file."); return secfailure; } do { count = pr_read(fd,buf,sizeof(buf)); if (count > 0) { pk11_randomupdate(buf,count); } } while (count > 0); pr_close(fd); return secsuccess; } /* * filesize */ long filesize(const char* filename) { struct stat stbuf; stat(filename, &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_geterror(), pr_getoserror()); 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"); rv = secfailure; goto clean...
NSS Sample Code sample4
argv) { secstatus rv; certcertificate *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_geterror()); goto cleanup; } cert = pk11_findcertfromnickname("testca", null); if (cert == null) { fprintf(stderr, "couldn't find cert testca in nss db (err %d)\n", pr_geterror()); goto cleanup; } pubkey = cert_extractpublickey(cert); if (pubkey == null) { fprintf(stderr, "couldn't extract public key from cert testca (err %...
...f2 = (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_geterror()); goto cleanup; } pvtkey = pk11_findkeybyanycert(cert, null); if (pvtkey == null) { fprintf(stderr, "couldn't find private key for cert testca (err %d)\n", pr_geterror()); goto cleanup; } /* clear buf1 */ for (i=0;i<modulus_len;i++) { buf1[i]= '\0'; } /* decrypt buf2, result will be in buf1 */ rv = pk11_pu...
...bdecryptraw(pvtkey, buf1, &outlen, modulus_len, buf2, modulus_len); if (rv != secsuccess) { fprintf(stderr, "decrypt with private key
failed (err %d)\n", pr_geterror()); 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; } ...
NSS Sample Code sample5
nickname; pk11slotinfo *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_geterror()); goto cleanup; } /* get internal slot */ slot = pk11_getinternalkeyslot(); if (slot == null) { fprintf(stderr, "couldn't find slot (err %d)\n", pr_geterror()); goto cleanup; } rv = atob_convertasciitoitem(&der, pubkstr); if (rv!= secsuccess) { fprintf(stderr, "atob_convertasciitoitem
failed %d\n", pr_geterror()); goto...
...f2 = (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_geterror()); 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_geterror()); goto cleanup; } /* ku_all includes a lot of different key usages, ku_d...
...rintf(stderr, "couldn't extract private key (err %d)\n", pr_geterror()); 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_geterror()); goto cleanup; } fprintf(stderr, "result of decryption, outlen = %d\n", outlen); fprintf(stderr, "result of decryption, buf = \n%s\n", buf1); cleanup: if (cert) cert_destroycertificate(cert); if (pubkey) seckey_destroypublickey(pubkey); if (pvtkey) seckey_destroyprivatekey(pvtkey); if (spki) seckey_destroysubjectpublickey...
NSS Sample Code sample6
*/ rv = nss_initreadwrite("."); if (rv != secsuccess) { fprintf(stderr, "nss initialization
failed (err %d)\n", pr_geterror()); exit(1); } /* generate a key with id 1.
... * 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_geterror()); 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) { fp...
...rintf(stderr, "pk11_findfixedkey
failed (err %d)\n", pr_geterror()); pk11_freeslot(slot); return; } fprintf(stderr, "found key!\n"); 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); pk11_freeslot(slot); } char *passwdcb(pk11slotinfo *info, prbool retry, void *arg) { if (!retry) return pl_strdup("test"); else return null; } ...
Utilities for nss samples
k11_gettokenname(slot)); return getpassword(stdin, stdout, prompt, checkpassword); case pw_fromfile: pw = filepasswd(slot, retry, pwdata->data); pwdata->source = pw_plaintext; pwdata->data = pl_strdup(pw); return pw; case pw_plaintext: return pl_strdup(pwdata->data); default: break; } pr_fprintf(pr_stderr, "password check
failed: no password found.\n"); return null; } /* * generaterandom */ secstatus generaterandom(unsigned char *rbuf, int rsize) { char meter[] = { "\r| |" }; int fd, count; int c; secstatus rv = secsuccess; cc_t orig_cc_min; cc_t orig_cc_time; tcflag_t ...
...way it was */ tio.c_lflag = orig_lflag; tio.c_cc[vmin] = orig_cc_min; tio.c_cc[vtime] = orig_cc_time; tcsetattr(fd, tcsaflush, &tio); return rv; } /* * seedfromnoisefile */ secstatus seedfromnoisefile(const char *noisefilename) { char buf[2048]; prfiledesc *fd; print32 count; fd = pr_open(noisefilename, pr_rdonly, 0); if (!fd) { fprintf(stderr, "
failed to open noise file."); return secfailure; } do { count = pr_read(fd,buf,sizeof(buf)); if (count > 0) { pk11_randomupdate(buf,count); } } while (count > 0); pr_close(fd); return secsuccess; } /* * filesize */ long filesize(const char* filename) { struct stat stbuf; stat(filename, &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_geterror(), pr_getoserror()); 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"); rv = secfailure; goto clean...
Python binding for NSS
when cert validation fails you can now obtain diagnostic information as to why the cert
failed to validate.
... certificate() constructor signature changed from certificate(data=none, der_is_signed=true) to certificate(data, certdb=cert_get_default_certdb(), perm=false, nickname=none) this change was necessary because all certs should be added to the nss temporary database when they are loaded, but earlier code
failed to to that.
... nss.ssl.config_server_session_id_cache_with_opt() nss.ssl.get_max_server_cache_locks() nss.ssl.set_max_server_cache_locks() nss.ssl.shutdown_server_session_id_cache() the following constants were added nss.nss.int.pk11_dis_could_not_init_token nss.nss.int.pk11_dis_none nss.nss.int.pk11_dis_token_not_present nss.nss.int.pk11_dis_token_verify_
failed nss.nss.int.pk11_dis_user_selected nss.nss.int.pkcs12_des_56 nss.nss.int.pkcs12_des_ede3_168 nss.nss.int.pkcs12_rc2_cbc_128 nss.nss.int.pkcs12_rc2_cbc_40 nss.nss.int.pkcs12_rc4_128 nss.nss.int.pkcs12_rc4_40 the following files were added test/run_tests test/test_cipher.py (replaces cipher_test.py) test/test_client_server.py te...
sslfnc.html
a bad-certificate callback function gives the application the opportunity to choose to accept the certificate as authentic and authorized even though it
failed the check performed by the certificate authentication callback function.
... ssl_badcerthook sets up a callback function to deal with a situation where the ssl_authcertificate callback function has
failed.
... the callback function returns one of these values: secsuccess: the callback has chosen to authorize the certificate for use in this ssl connection, despite the fact that it
failed the examination by the certificate authentication callback.
Tracing JIT
the term bail denotes "exiting a trace due to to a
failed guard".
... when a guard bails, it means that there is no logic in the trace to handle the
failed guard, and so the exit condition encodes the state of the interpreter before the guarded condition.
...bailing from a regular guard involves executing precise per-guard write-flushing code, as the guard encodes a specific
failed condition on a specific set of operands, and so the exit code can be much more fine-grained about and reconstructing the pre-bail state.
Running Automated JavaScript Tests
the first time this is run, it runs the suite and writes a list of tests that
failed to the given filename.
... the next time it is run, it will run only the tests in the given filename, and then will write the list of tests that
failed when it is done.
... thus, you can keep retesting as you fix bugs and only the tests that
failed the last time will run, speeding things up a bit.
TPS Tests
determines if the phase passed or
failed; if it passed, it continues to the next phase block and repeats the process.
... tps runs one "cleanup" phase for each profile (even for
failed tests), which means most tests have two cleanup phases.
...this means you may want to run a tps test twice to see if it really
failed, or it just started with garbage.
Finishing the Component
sicomponentmanager *acompmgr, nsifile *apath, const char *registrylocation, const char *componenttype, const nsmodulecomponentinfo *info) { nsresult rv; nscomptr<nsiservicemanager> servman = do_queryinterface((nsisupports*)acompmgr, &rv); if (ns_
failed(rv)) return rv; nscomptr<nsicategorymanager> catman; servman->getservicebycontractid(ns_categorymanager_contractid, ns_get_iid(nsicategorymanager), getter_addrefs(catman)); if (ns_
failed(rv)) return rv; char* previous = nsnull; rv = catman->addcategoryentry("xpcom-startup", "web...
... *_retval = pr_false; nsresult rv; nscomptr<nsiservicemanager> servman; rv = ns_getservicemanager(getter_addrefs(servman)); if (ns_
failed(rv)) return rv; nscomptr<nsiioservice> mioservice; // get a pointer to the ioservice rv = servman->getservicebycontractid("@mozilla.org/network/io-service;1", ns_get_iid(nsiioservice), getter_addrefs(mioservice)); if (ns_
failed(rv)) return rv; urlnode* node = mrooturlnode; prbool match = pr_false; ...
... while (node) { nscomptr<nsiuri> uri; nsembedcstring urlstring(node->urlstring); rv = mioservice->newuri(urlstring, nsnull, nsnull, getter_addrefs(uri)); // if anything bad happens, just abort if (ns_
failed(rv)) return rv; nsembedcstring host; uri->gethost(host); if (strcmp(hosttoload.get(), host.get()) == 0) { // match found.
Observer Notifications
bookmarks-restore-
failed json sent when bookmarks could not be sucessfully restored from json.
... bookmarks-restore-
failed html sent when bookmarks could not be successfully restored from html.
... bookmarks-restore-
failed html-initial sent when bookmarks could not be successfully restored from html on intial import.
Using the Mozilla symbol server
the output of this command should be similar to: symchk: fullsoft.dll
failed - image is split correctly, but fullsoft.dbg is missing symchk: qfaservices.dll
failed - qfaservices.pdb mismatched or not found symchk: talkback.exe
failed - built without debugging information.
... symchk: helper.exe
failed - built without debugging information.
... symchk:
failed files = 4 symchk: passed + ignored files = 179 downloading symbols on linux / mac os x if you are on linux and running gdb 7.9 or newer, you can use this gdb python script to automatically fetch symbols.
Constants - Plugins
nperr_module_load_
failed_error 4 loading of plug-in
failed.
... nperr_out_of_memory_error 5 memory allocation
failed.
... npres_network_err 1 stream
failed due to problems with network, disk i/o, lack of memory, or other problems.
console.assert() - Web APIs
bject 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...
...firefox v60.0.2): // assertion
failed: the word is foo // incorrect output in some browsers // (e.g.
... chrome v67.0.3396.87): // assertion
failed: the word is %s foo see outputting text to the console in the documentation of console for further details.
IDBDatabaseException - Web APIs
constraint_err 4 a mutation operation in the transaction
failed because a constraint was not satisfied.
... not_found_err 3 the operation
failed because the requested database object could not be found; for example, an object store did not exist but was being opened.
... unknown_err 1 the operation
failed for reasons unrelated to the database itself, and it is not covered by any other error code--for example, a failure due to disk io errors.
PaymentRequest.show() - Web APIs
processing the result and, if necessary, calling paymentresponse.retry() to retry a
failed payment can all be done either asynchronously or synchronously, depending on your needs.
... the validateresponse() method, below, is called once show() returns, in order to look at the returned response and either submit the payment or reject the payment as
failed: async function validateresponse(response) { try { if (await checkallvalues(response)) { await response.complete("success"); } else { await response.complete("fail"); } } catch(err) { await response.complete("fail"); } } here, a custom function called checkallvalues() looks at each value in the response and ensures that they're valid, returning true if every f...
... if any fields have unacceptable values, or if an exception is thrown by the previous code, complete() is called with the string "fail", which indicates that the payment process is complete and
failed.
PaymentResponse.retry() - Web APIs
payer optional a payererrors compliant object which provides appropriate error messages for any of the fields describing the payer which
failed validation.
... shippingaddress optional an addresserrors object which contains error messages for any of the fields in the shipping address that
failed validation.
... if show() is rejected, the payment request
failed, usually because either there's already one being processed, because the user agent doesn't support any of the specified payment methods, or because of a security issue.
Using the Payment Request API - Web APIs
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.
...ponse.complete('success') .then(function() { // for demo purposes: intropanel.style.display = 'none'; successpanel.style.display = 'block'; }); }).catch(function(error) { if (error.code == domexception.not_supported_err) { window.location.href = 'https://bobpay.xyz/#download'; } else { // other kinds of errors; cancelled or
failed payment.
... } else { // pre-authorization
failed or payment handler not installed.
RTCDtlsTransport.state - Web APIs
failed the transport has
failed as the result of an error (such as receipt of an error alert or failure to validate the remote fingerprint).
...*/ function tallysenders(pc) { let results = { transportmissing: 0, connectionpending: 0, connected: 0, closed: 0,
failed: 0, unknown: 0 }; let senderlist = pc.getsenders(); senderlist.foreach(sender => { let transport = sender.transport; if (!transport) { results.transportmissing++; } else { switch(transport.state) { case "new": case "connecting": results.connectionpending++; break; case "connected": results.connected++; ...
... break; case "closed": results.closed++; break; case "
failed": results.
failed++; break; default: results.unknown++; break; } } }); return results; } note that in this code, the new and connecting states are being treated as a single connectionpending status in the returned object.
RTCIceTransport.state - Web APIs
if consent checks fail on all successful candidate pairs, the transport state will change to "
failed".
...this is not a failure state (that's "
failed").
... "
failed" the rtcicetransport has finished the gathering process, has received the "no more candidates" notification from the remote peer, and has finished checking pairs of candidates, without successfully finding a pair that is both valid and for which consent can be obtained.
RTCIceTransportState - Web APIs
if consent checks fail on all successful candidate pairs, the transport state will change to "
failed".
...this is not a failure state (that's "
failed").
... "
failed" the rtcicetransport has finished the gathering process, has received the "no more candidates" notification from the remote peer, and has finished checking pairs of candidates, without successfully finding a pair that is both valid and for which consent can be obtained.
RTCOfferOptions.iceRestart - Web APIs
usage notes when the rtcpeerconnection object's ice connection state changes to
failed, you should try to trigger an ice restart.
...it watches for the ice connection state to transition to "
failed", which indicates that an ice restart should be tried in order to attempt to bring the connection back up.
... pc.oniceconnectionstatechange = function(evt) { if (pc.iceconnectionstate === "
failed") { if (pc.restartice) { pc.restartice(); } else { pc.createoffer({ icerestart: true }) .then(pc.setlocaldescription) .then(sendoffertoserver); } } } if the state changes to
failed, this handler starts by looking to see if the rtcpeerconnection includes the restartice() method; if it does, we call that to request an ice restart.
RTCPeerConnection.iceConnectionState - Web APIs
"
failed" the ice candidate has checked all candidates pairs against one another and has
failed to find compatible matches for all components of the connection.
... "disconnected" checks to ensure that components are still connected
failed for at least one component of the rtcpeerconnection.
... this is a less stringent test than "
failed" and may trigger intermittently and resolve just as spontaneously on less reliable networks, or during temporary disconnections.
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.
Using XMLHttpRequest - Web APIs
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", transfer
failed); 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 transfer
failed(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.
...the upload events are fired on the xmlhttprequest.upload object, as shown below: var oreq = new xmlhttprequest(); oreq.upload.addeventlistener("progress", updateprogress); oreq.upload.addeventlistener("load", transfercomplete); oreq.upload.addeventlistener("error", transfer
failed); oreq.upload.addeventlistener("abort", transfercanceled); oreq.open(); note: progress events are not available for the file: protocol.
Audio and Video Delivery - Developer guides
this lets you detect which sources
failed to load, which may be useful.
...sic and video player handbrake — open source video transcoder firefogg — video and audio encoding for firefox ffmpeg2 — comprehensive command line encoder libav — comprehensive command line encoder vid.ly — video player,transcoding and delivery internet archive — free transcoding and storage detecting when no sources have loaded to detect that all child <source> elements have
failed to load, check the value of the media element's networkstate attribute.
... if this is htmlmediaelement.network_no_source, you know that all the sources
failed to load.
HTTP response status codes - HTTP
412 precondition
failed the client has indicated preconditions in its headers which the server does not meet.
... 417 expectation
failed this response code means the expectation indicated by the expect request header field can't be met by the server.
... 424
failed dependency (webdav) the request
failed due to failure of a previous request.
core/promise - Archive of obsolete content
promises consider another approach, instead of continuation via callbacks, a function returns an object that represents a eventual result, either successful or
failed.
...this can be used to perform an action that requires values from several promises, like getting user information and server status, for example: const { all } = require('sdk/core/promise'); all([getuser, getserverstatus]).then(function (result) { return result[0] + result[1] }); if one of the promises in the array is rejected, the rejection handler handles the first
failed promise and remaining promises remain unfulfilled.
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
copy the following files into the content sub-subdirectory: tinderstatusoverlay.xul tinderstatus.js tinderstatus.css tb-busted.png tb-nostatus.png tb-success.png tb-test
failed.png these are the files we're going to put into the xpi.
... status="none"/> </statusbar> </overlay> we also need to change the urls in the copy of tinderstatus.css: statusbarpanel#tinderbox-status { list-style-image: url("chrome://tinderstatus/content/tb-nostatus.png"); } statusbarpanel#tinderbox-status[status="success"] { list-style-image: url("chrome://tinderstatus/content/tb-success.png"); } statusbarpanel#tinderbox-status[status="test
failed"] { list-style-image: url("chrome://tinderstatus/content/tb-test
failed.png"); } statusbarpanel#tinderbox-status[status="busted"] { list-style-image: url("chrome://tinderstatus/content/tb-busted.png"); } then we need to create two files in the directory, one called contents.rdf which contains information for the chrome registry about the component being installed and one called install.js t...
Specifying the appearance - Archive of obsolete content
for this we have to first create four icons, one for each tinderbox state (none, success, test
failed, and busted), then create a set of css rules that displays the icon corresponding to the current tinderbox state: statusbarpanel#tinderbox-status { list-style-image: url("chrome://navigator/content/tb-nostatus.png"); } statusbarpanel#tinderbox-status[status="success"] { list-style-image: url("chrome://navigator/content/tb-success.png"); } statusbarpanel#tinderbox-status[status="test
failed"] { list-style-image: url("chrome://navigator/content/tb-test
failed.png"); } statusbarpanel#tinderbox-status[status="busted"] { list-style-image: url("chrome://navigator/content/tb-buste...
...make your own icons for the four states or use the following icons: no status , success , test
failed and busted .
Tinderbox - Archive of obsolete content
whether or not any clients have
failed.
...if any clients have
failed to build, we will display a red icon that signifies a build failure; if all clients built successfully but some
failed tests we will display an orange icon that signifies a test failure.
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
on 1.9a1 ^^ try { file grepath = mozilla.getgrepathwithproperties(range, null); locationprovider locprovider = new locationprovider(grepath); mozilla.initembedding(grepath, grepath, locprovider); } catch (filenotfoundexception e) { // this exception is thrown if gregrepathwithproperties cannot find a gre } catch (xpcomexception e) { // this exception is thrown if initembedding
failed } locationprovider is a class provided by the java application.
...once the java application is done using mozilla, it needs to terminate the embedding process: try { mozilla.termembedding(); } catch (xpcomexception e) { // this exception is thrown if termembedding
failed } working with xpcom objects now that mozilla is embedded, the java application can work with xpcom objects.
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.
...n 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 w...
Vulnerabilities - Archive of obsolete content
an example is the number of consecutive
failed authentication attempts to permit before locking out a user account.
... setting this to 1 would be the most secure setting against password guessing attacks, but it would also cause legitimate users to be locked out after mistyping a password once, and it would also permit attackers to perform denial-of-service attacks against users more easily by generating a single
failed login attempt for each user account.
LiveConnect Overview - Archive of obsolete content
use a try...catch statement such as the following to handle liveconnect exceptions in javascript 1.3 and earlier versions: try { global.eval("foo.bar = 999;"); } catch (exception e) { if (e instanceof jsexception) { jscode
failed(); } else { othercode
failed(); } } in this example, the eval statement fails if foo is not defined.
... the catch block executes the jscode
failed method if the eval statement in the try block throws a jsexception; the othercode
failed method executes if the try block throws any other error.
Graceful asynchronous programming with Promises - Learn web development
something like this: function handlecallbutton(evt) { setstatusmessage("calling..."); navigator.mediadevices.getusermedia({video: true, audio: true}) .then(chatstream => { selfviewelem.srcobject = chatstream; chatstream.gettracks().foreach(track => mypeerconnection.addtrack(track, chatstream)); setstatusmessage("connected"); }).catch(err => { setstatusmessage("
failed to connect"); }); } this function starts by using a function called setstatusmessage() to update a status display with the message "calling...", indicating that a call is being attempted.
... if a promise has succeeded or
failed and you later add a success/failure callback, the correct callback will be called, even though the event took place earlier.
Client-side storage - Learn web development
now add the following event handlers just below your previous addition — again inside the window.onload handler: // onerror handler signifies that the database didn't open successfully request.onerror = 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.onerror handler will run if the system comes back saying that the request
failed.
Deploying our app - Learn web development
if there's a failure the test fails with an exit code of 1 — this is a system-level value that says "something
failed".
... could you set up a notification to let you know when a new deploy succeeded or
failed?
Extending a Protocol
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!
...we can now finally finish off ::echo(): 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; } errorresult rv; auto echochild = getechochild(rv); puts("[navigator.cpp] sending echo!"); // let's send astring to the parent!
Infallible memory allocation
this is in contrast to a traditional, fallible memory allocator that can return null indicating that the request
failed.
... the term "infallible" means that your memory allocation request is guaranteed to succeed: your code can never see a
failed request, and so doesn't need to check for failure.
AddonManager
state_download_
failed an install that
failed to download.
... state_install_
failed an install that has
failed to install.
DownloadError
becausesource
failed read only boolean indicates an error occurred while reading from the remote location.
... becausetarget
failed read only boolean indicates an error occurred while writing to the local target.
Promise
if you see the message "a promise chain
failed to handle a rejection", there is likely something to be fixed in the code.
... warning: if the onfulfill callback throws an exception, the onreject callback is not invoked and the exception won't be caught, nor shown in the console (you will see a promise chain
failed error).
Investigating leaks using DMD heap scan mode
dmd heap scan mode is a "tool of last resort" that should only be used when all other avenues have been tried and
failed, except possibly ref count logging.
...secondly, you may need to comment out the call to moz_crash("nss_shutdown
failed"); in xpcom/build/xpcominit.cpp, as this also seems to trigger when shutdown is extremely slow.
NSPR Error Handling
pr_directory_lookup_error a directory lookup on a network address has
failed.
... pr_file_is_locked_error an attempt to acquire a lock on a file has
failed because the file is already locked.
PR_GetConnectStatus
if pr_geterror 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.
...when pr_poll returns, call pr_getconnectstatus on the socket to determine whether the nonblocking connect has succeeded or
failed.
FC_InitToken
ckr_token_write_protected we don't have a reference to the key database (we
failed to open the key database or we have released our reference).
... ckr_device_error:
failed to reset the key database.
FC_Initialize
ckr_device_error we
failed to create the oid tables, random number generator, or internal locks.
... (note: we probably should return ckr_host_memory instead.) the software integrity test or power-up self-tests
failed.
NSC_InitToken
slot 1 doesn't have a key database.) we don't have a reference to the key database (we
failed to open the key database or we have released our reference).
... ckr_device_error:
failed to reset the key database.
Hacking Tips
now you can run rr replay to replay that last (
failed) run under gdb.
... run the engine under a debugger and set a breakpoint on the function js_
failedallocbreakpoint.
Components.isSuccessCode
const cc = components.classes; const ci = components.interfaces; const cr = components.results; // global flags polled externally var copy
failed = false; var copyinprogress = false; function copybufferedstream(instream, outstream) { var copyobserver = { onstartrequest: function(request, context) { copyinprogress = true; }, onstoprequest: function(request, context, statuscode) { copyinprogress = false; // did the copy fail?
... if (!components.issuccesscode(statuscode)) copy
failed = 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); } ...
mozIAsyncFavicons
similarly, if the icon is in the
failed favicon cache we will not do anything unless aforcereload is true, in which case we'll try to reload the favicon.
...icons that fail to load will automatically be added to the
failed favicon cache, and this function will not save favicons for non-bookmarked uris when history is disabled.
mozIStorageError
full 13 an insertion
failed because the database is full.
... nomem 7 a memory allocation
failed.
mozIStorageService
ns_error_out_of_memory allocating a new storage object
failed.
... ns_error_out_of_memory allocating a new storage object
failed.
nsICategoryManager
nsresult printallcategories() { nsresult rv; nscomptr<nsiservicemanager> svcmgr; rv = ns_getservicemanager(getter_addrefs(svcmgr)); if (ns_
failed(rv)) return rv; nscomptr<nsicategorymanager> catmgr; rv = svcmgr->getservicebycontractid(ns_categorymanager_contractid, ns_get_iid(nsicategorymanager), getter_addrefs(catmgr)); if (ns_
failed(rv)) return rv; nscomptr<nsisimpleenumerator> cats; rv = catmgr->enumeratecategories(getter_addrefs(cats))...
...; if (ns_
failed(rv)) return rv; prbool hasmore; while (ns_succeeded(cats->hasmoreelements(&hasmore) && hasmore) { nscomptr<nsisupports> elem; cats->getnext(getter_addrefs(elem)); nscomptr<nsisupportscstring> category = do_queryinterface(elem, &rv); if (ns_
failed(rv)) break; nsembedcstring categoryname; rv = category->getdata(categoryname); if (ns_
failed(rv)) break; printf("%s\n", categoryname.get()); } return ns_ok; } this snippet shows how to print out a list of all categories in javascript.
nsIPlacesImportExportService
"bookmarks-restore-
failed" is fired right after a failure occurs when importing the bookmarks.
..."bookmarks-restore-
failed" is fired right after a failure occurs when importing the bookmarks.
nsIProcess
the observer will receive this nsiprocess instance as the subject and "process-finished" or "process-
failed" as the topic.
...the observer will receive this nsiprocess instance as the subject and "process-finished" or "process-
failed" as the topic.
nsIProtocolProxyService
when this flag is passed to resolve, resolve may throw the exception ns_base_stream_would_block to indicate that it
failed due to this flag being present.
...a proxy is disabled if it had previously
failed-over to another proxy (see getfailoverforproxy()).
nsITextInputProcessor
return value when there is no composition which was created by the instance and if compositionstart is consumed by web contents, i.e.,
failed to start new composition, this returns false.
... return value when there is no composition which was created by the instance and if compositionstart is consumed by web contents, i.e.,
failed to start new composition, this returns false.
nsIWebBrowserPersist
persist_flags_cleanup_on_failure 8192 automatically cleanup after a
failed or cancelled operation, deleting all created files and directories.
... this flag does nothing for
failed upload operations to remote servers.
NS ENSURE SUCCESS
summary macro returns return-value if ns_
failed(nsresult) evaluates to true, and shows a warning on stderr in that case.
... syntax ns_ensure_success(nsresult, return-value); usage nsresult mozmyclass::mozstringmucking() { nsresult rv = ns_cstringcopy(mdeststring, msrcstring); ns_ensure_success(rv, rv); // this is the same as doing: nsresult rv = ns_cstringcopy(mdeststring, msrcstring); if (ns_
failed(rv)) return rv; return ns_ok; } ...
Streams - Plugins
npres_network_err: the stream
failed because of problems with the network, disk i/o error, lack of memory, or some other problem.
... npres_network_err: the stream
failed because of network problems.
GeolocationPositionError.code - Web APIs
the following values are possible: value associated constant description 1 permission_denied the acquisition of the geolocation information
failed because the page didn't have the permission to do it.
... 2 position_unavailable the acquisition of the geolocation
failed because one or several internal sources of position returned an internal error.
GeolocationPositionError - Web APIs
the following values are possible: value associated constant description 1 permission_denied the acquisition of the geolocation information
failed because the page didn't have the permission to do it.
... 2 position_unavailable the acquisition of the geolocation
failed because at least one internal source of position returned an internal error.
IDBRequest.error - Web APIs
unknownerror if the operation
failed for reasons unrelated to the database itself.
...for example, if the the request
failed and the result is not available, the invalidstateerror exception is thrown.
Node.removeChild() - Web APIs
f 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 notfounderror:
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 typeerror:
failed to execute 'removechild' on 'node': parameter 1 is not of type 'node'.
PayerErrors - Web APIs
name optional if this domstring is present in the object, the paymentresponse.payername property
failed validation, and this string explains what needs to be corrected.
... if this property is absent, the paer name is fine phone optional if present, this string is an error message explaining why the payer's phone number (paymentresponse.payerphone)
failed validation.
PaymentValidationErrors - Web APIs
payer optional a payererrors compliant object which provides appropriate error messages for any of the fields describing the payer which
failed validation.
... shippingaddress optional an addresserrors object which contains error messages for any of the fields in the shipping address that
failed validation.
RTCDtlsTransport - Web APIs
*/ function tallysenders(pc) { let results = { transportmissing: 0, connectionpending: 0, connected: 0, closed: 0,
failed: 0, unknown: 0 }; let senderlist = pc.getsenders(); senderlist.foreach(sender => { let transport = sender.transport; if (!transport) { results.transportmissing++; } else { switch(transport.state) { case "new": case "connecting": results.connectionpending++; break; case "connected": results.connected++; ...
... break; case "closed": results.closed++; break; case "
failed": results.
failed++; break; default: results.unknown++; break; } } }); return results; } note that in this code, the new and connecting states are being treated as a single connectionpending status in the returned object.
RTCIceTransport.onstatechange - Web APIs
example this snippet establishes a handler for the statechange event that looks to see if the transport has entered the "
failed" state, which indicates that the connection has
failed with no chance of being automatically restored.
... var icetransport = pc.getsenders()[0].transport.icetransport; icetransport.onstatechange = function(event) { if (icetransport.state == "
failed") { handlefailure(pc); } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicetransport.onstatechange' in that specification.
RTCPeerConnection.createAnswer() - Web APIs
failurecallback an rtcpeerconnectionerrorcallback which will be passed a single domexception object explaining why the request to create an answer
failed.
... operationerror generation of the sdp
failed for some reason; this is a general failure catch-all exception.
RTCPeerConnection.createOffer() - Web APIs
errorcallback an rtcpeerconnectionerrorcallback which will be passed a single domexception object explaining why the request to create an offer
failed.
... operationerror examining the state of the system to determine resource availability in order to generate the offer
failed for some reason.
RTCPeerConnection: iceconnectionstatechange event - Web APIs
bubbles no cancelable no interface event event handler property oniceconnectionstatechange one common task performed by the iceconnectionstatechange event listener: to trigger ice restart when the state changes to
failed.
...if no suitable candidates were found, the state transitions to
failed.
RTCPeerConnection.restartIce() - Web APIs
example this example creates a handler for the iceconnectionstatechange event that handles a transition to the
failed state by restarting ice in order to try again.
... pc.addeventlistener("iceconnectionstatechange", event => { if (pc.iceconnectionstate === "
failed") { /* possibly reconfigure the connection in some way here */ /* then request ice restart */ pc.restartice(); } }); with this code in place, a transition to the
failed state during ice negotiation will cause a negotiationneeded event to be fired, in response to which your code should renegotiate as usual.
Using Service Workers - Web APIs
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.
...sn’t available, you could just match the request with some kind of default fallback page as a response using match(), like this: caches.match('./fallback.html'); you can retrieve a lot of information about each request by calling parameters of the request object returned by the fetchevent: event.request.url event.request.method event.request.headers event.request.body recovering
failed requests so caches.match(event.request) is great when there is a match in the service worker cache, but what about cases when there isn’t a match?
SpeechSynthesisErrorEvent.error - Web APIs
e (for example, the user may need to correct this by closing another application.) audio-hardware the operation couldn't be completed at this time because the user-agent couldn't identify an audio output device (for example, the user may need to connect a speaker or configure system settings.) network the operation couldn't be completed at this time because some required network communication
failed.
... 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.
Clearing by clicking - Web APIs
// if
failed, alert user of failure.
... if (!gl) { gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { alert("
failed to get webgl context.\n" + "your browser or device may not support webgl."); return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); } // get a random color value using a helper function.
Clearing with colors - Web APIs
var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); // if
failed, inform user of failure.
... if (!gl) { paragraph.innerhtml = "
failed to get webgl context.
Adding 2D content to a WebGL context - Web APIs
rce, fssource) { const vertexshader = loadshader(gl, gl.vertex_shader, vssource); const fragmentshader = loadshader(gl, gl.fragment_shader, fssource); // create the shader program const shaderprogram = gl.createprogram(); gl.attachshader(shaderprogram, vertexshader); gl.attachshader(shaderprogram, fragmentshader); gl.linkprogram(shaderprogram); // if creating the shader program
failed, alert if (!gl.getprogramparameter(shaderprogram, gl.link_status)) { alert('unable to initialize the shader program: ' + gl.getprograminfolog(shaderprogram)); return null; } return shaderprogram; } // // creates a shader of the given type, uploads the source and // compiles it.
...if that's false, we know the shader
failed to compile, so show an alert with log information obtained from the compiler using gl.getshaderinfolog(), then delete the shader and return null to indicate a failure to load the shader.
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
the old way in the past, if you encountered an ice error and needed to restart negotiation, you might have done something like this: pc.onnegotiationneeded = async options => { await pc.setlocaldescription(await pc.createoffer(options)); signaler.send({ description: pc.localdescription }); }; pc.oniceconnectionstatechange = () => { if (pc.iceconnectionstate === "
failed") { pc.onnegotiationneeded({ icerestart: true }); } }; this has a number of reliability issues and outright bugs (such as failing if the iceconnectionstatechange event fires when the signaling state isn't stable), but there was no way you could actually request an ice restart other than by creating and sending an offer with the icerestart option set to true.
... using restartice() now, you can use restartice() to do this much more cleanly: pc.onnegotiationneeded = async options => { await pc.setlocaldescription(await pc.createoffer(options)); signaler.send({ description: pc.localdescription }); }; pc.oniceconnectionstatechange = () => { if (pc.iceconnectionstate === "
failed") { pc.restartice(); } }; with this improved technique, instead of directly calling onnegotiationneeded with options to trigger ice restart, the
failed ice connection state simply calls restartice().
Signaling and video calling - Web APIs
this can help you know when the connection has
failed, or been lost.
... function handleiceconnectionstatechangeevent(event) { switch(mypeerconnection.iceconnectionstate) { case "closed": case "
failed": closevideocall(); break; } } here, we apply our closevideocall() function when the ice connection state changes to "closed" or "
failed".
Migrating from webkitAudioContext - Web APIs
d then decoded it using createbuffer(): var xhr = new xmlhttprequest(); xhr.open("get", "/path/to/audio.ogg", true); xhr.responsetype = "arraybuffer"; xhr.send(); xhr.onload = function() { var decodedbuffer = context.createbuffer(xhr.response, false); if (decodedbuffer) { // decoding was successful, do something useful with the audio buffer } else { alert("decoding the audio buffer
failed"); } }; converting this code to use decodeaudiodata() is relatively simple, as can be seen below: var xhr = new xmlhttprequest(); xhr.open("get", "/path/to/audio.ogg", true); xhr.responsetype = "arraybuffer"; xhr.send(); xhr.onload = function() { context.decodeaudiodata(xhr.response, function onsuccess(decodedbuffer) { // decoding was successful, do something useful with the audio buff...
...er }, function onfailure() { alert("decoding the audio buffer
failed"); }); }; note that the decodeaudiodata() method is asynchronous, which means that it will return immediately, and then when the decoding finishes, one of the success or failure callback functions will get called depending on whether the audio decoding was successful.
Expect - HTTP
the only expectation defined in the specification is expect: 100-continue, to which the server shall respond with: 100 if the information contained in the header is sufficient to cause an immediate success, 417 (expectation
failed) if it cannot meet the expectation; or any other 4xx status otherwise.
... put /somewhere/fun http/1.1 host: origin.example.com content-type: video/h264 content-length: 1234567890987 expect: 100-continue the server now checks the request headers and may respond with a 100 (continue) response to instruct the client to go ahead and send the message body, or it will send a 417 (expectation
failed) status if any of the expectations cannot be met.
Using Promises - JavaScript
a catch, which is useful to accomplish new actions even after an action
failed in the chain.
... 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.
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 validationerror extends error { printcustomermessage() { return `validation
failed :-( (details: ${this.message})`; } } try { throw new validationerror("not a valid phone number"); } catch (error) { if (error instanceof validationerror) { console.log(error.name); // this is error instead of validationerror!
...for example: class validationerror extends error { constructor(message) { super(message); // call parent class constructor this.name = 'validationerror'; this.code = '42'; } printcustomermessage() { return `validation
failed :-( (details: ${this.message}, code: ${this.code})`; } } try { throw new validationerror("not a valid phone number"); } catch (error) { if (error instanceof validationerror) { console.log(error.name); // now this is validationerror!
Promise - JavaScript
rejected: meaning that the operation
failed.
... examples basic example let myfirstpromise = new promise((resolve, reject) => { // we call resolve(...) when what we were doing asynchronously was successful, and reject(...) when it
failed.
Caching compiled WebAssembly modules - WebAssembly
function storeindatabase(db, module) { var store = db.transaction([storename], 'readwrite').objectstore(storename); var request = store.put(module, url); request.onerror = err => { console.log(`
failed to store in wasm cache: ${err}`) }; request.onsuccess = err => { console.log(`successfully stored ${url} in wasm cache`) }; } using our helper functions with all the promise-based helper functions defined, we can now express the core logic of an indexeddb cache lookup.
... if opening the database
failed (for example due to permissions or quota), we fall back to simply fetching and compiling the module and don't try to store the results (since there is no database to store them into).
Finding window handles - Archive of obsolete content
elltreeitem) .treeowner .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsibasewindow); then in c++ part, a function take nsibasewindow as param hwnd getparentwindowhwnd(nsibasewindow *window) { nativewindow hwnd; nsresult rv = window->getparentnativewindow(&hwnd); if (ns_
failed(rv)) return null; return (hwnd)hwnd; } that's it; use with caution!
NS_CStringGetMutableData
this value will be zero if the function
failed to resize its internal buffer to the size requested.
Reference Manual
we just
failed to release p before putting a new pointer into it.
Using nsIPasswordManager
alert(pass.user); // the username alert(pass.password); // the password break; } } catch (ex) { // do something if decrypting the password
failed--probably a continue } } note that the user will be prompted for their master password if they have chosen to set one to secure their passwords.
Autoconfiguration in Thunderbird
guessing if all other mechanisms
failed, thunderbird tries to guess the configuration, by trying common server names like imap.<domain>, smtp.<domain>, mail.<domain> etc., and, when a mail server answers, checking whether it supports ssl, starttls and encrypted passwords (cram-md5).
Events
older is being loaded onleavingfolder a folder is being unloaded, includes deletion onloadingfolder a folder is being loaded onmakeactive a folderdisplaywidget becomes active onmessagecountschanged the counts of the messages changed onmessagesloaded the messages in the folder have been loaded onmessagesremoval
failed removing some messages from the current folder
failed onmessagesremoved some messages of the current message list have been removed onsearching a folder view derived from a search is being loaded, e.g.
Activity Manager examples
ts ns_decl_nsiactivityundohandler mycopyeventundo() {} private: ~mycopyeventundo() {} }; ns_impl_isupports1(mycopyeventundo, nsiactivityundohandler) ns_imethodimp mycopyeventundo::undo(nsiactivityevent *event, nsresult *result) { nsresult rv; // get the subjects of this copy event pruint32 length; nsivariant **subjectlist; rv = event->getsubjects(&length, &subjectlist); if(ns_
failed(rv)) return rv; // first subject in the list is the source folder in this particular case nscomptr<nsimsgfolder> folder = do_queryinterface(subjectlist[0]); // get the initiator nsivariant *initiator; event->getinitiator(&initiator); if (initiator) { nsisupports* ptr; rv = object->getasisupports(&ptr); if(ns_
failed(rv)) return rv; nscomptr<nsimsgcopyser...
Using js-ctypes
fusernotificationdisplaynotice(0, kcfusernotificationcautionalertlevel, null, null, null, mycfstrs.head, mycfstrs.body, null); console.info('rez:', rez, rez.tostring(), uneval(rez)); // cfusernotificationdisplaynotice does not block till user clicks dialog, it will return immediately if (rez.tostring() == '0') { console.log('notification was succesfully shown!!'); } else { console.error('
failed to show notification...
Mozilla
this is in contrast to a traditional, fallible memory allocator that can return null indicating that the request
failed.
URLs - Plugins
without this notification, the plug-in cannot tell whether a request with a null target
failed or a request with a non-null target was completed.
Network request list - Firefox Developer Tools
image thumbnails if the request is for an image, hovering over its filename shows a preview of the image in a tooltip: security icons the network monitor displays an icon in the domain column: this gives you extra information about the security status of the request: icon meaning https weak https (for example, a weak cipher was used)
failed https (for example, a certificate was invalid) http localhost indicates that the url belongs to a known tracker that would be blocked with content blocking enabled.
Cache.match() - Web APIs
if (event.request.method === 'get' && event.request.headers.get('accept').indexof('text/html') !== -1) { console.log('handling fetch event for', event.request.url); event.respondwith( fetch(event.request).catch(function(e) { console.error('fetch
failed; returning offline page instead.', e); return caches.open(offline_cache).then(function(cache) { return cache.match(offline_url); }); }) ); } }); specifications specification status comment service workersthe definition of 'cache match' in that specification.
Clipboard.writeText() - Web APIs
navigator.clipboard.writetext("<empty clipboard>").then(function() { /* clipboard successfully set */ }, function() { /* clipboard write
failed */ }); specifications specification status comment clipboard api and eventsthe definition of 'writetext()' in that specification.
console - Web APIs
for example: console.log("
failed to open the specified link") this page documents the methods available on the console object and gives a few usage examples.
ContentIndex.add() - Web APIs
zes: '128x128', type: 'image/png', }], category: 'article' }; // our asynchronous function to add indexed content async function registercontent(data) { const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('
failed to register content: ', e.message); } } the add method can also be used within the service worker scope.
HTMLMediaElement: stalled event - Web APIs
using addeventlistener(): const video = document.queryselector('video'); video.addeventlistener('stalled', (event) => { console.log('
failed to fetch data, but trying.'); }); using the onstalled event handler property: const video = document.queryselector('video'); video.onstalled = (event) => { console.log('
failed to fetch data, but trying.'); }; specifications specification status html living standardthe definition of 'stalled media event' in that specification.
HTMLTrackElement - Web APIs
error 3 indicates that the text track was enabled, but when the user agent attempted to obtain it, this
failed in some way.
Ajax navigation example - Web APIs
401: "unauthorized", 402: "payment required", 403: "forbidden", 404: "not found", 405: "method not allowed", 406: "not acceptable", 407: "proxy authentication required", 408: "request timeout", 409: "conflict", 410: "gone", 411: "length required", 412: "precondition
failed", 413: "request entity too large", 414: "request-uri too long", 415: "unsupported media type", 416: "requested range not satisfiable", 417: "expectation
failed", 422: "unprocessable entity", 423: "locked", 424: "
failed dependency", 425: "unassigned", 426: "upgrade required", ...
IDBObjectStore.add() - Web APIs
constrainterror an insert operation
failed because the primary key constraint was violated (due to an already existing record with the same primary key value).
IDBRequest - Web APIs
if the the request
failed and the result is not available, an invalidstateerror exception is thrown.
Basic concepts - Web APIs
you get notified by a dom event when the operation finishes, and the type of event you get lets you know if the operation succeeded or
failed.
Checking when a deadline is due - Web APIs
the next few lines open the database transaction and provide messages to notify the user if this was successful or
failed.then an objectstore is created into which the new item is added.
InstallEvent - Web APIs
efetch); 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); }) ); }); specifications specification status comment service workers working draft as of may 2015, the install event is an instance of extendableevent rather than a child of it.
install - Web APIs
example function xpinstallcallback(url, status) { if (status == 0) msg = "xpinstall test: passed\n"; else msg = "xpinstall test:
failed\n"; dump(msg); alert(msg); } xpi={'xpinstall pre-checkin test':'pre_checkin.xpi'}; installtrigger.install(xpi,xpinstallcallback); ...
load() - Web APIs
return value a promise that resolves to a boolean indicating whether the load succeeded or
failed.
remove() - Web APIs
return value a promise that resolves to a boolean indicating whether the load succeeded or
failed.
Using the Media Capabilities API - Web APIs
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=v...
Capabilities, constraints, and settings - Web APIs
} else { let constraints = { width: { min: 640, ideal: 1920, max: 1920 }, height: { min: 400, ideal: 1080 }, aspectratio: 1.777777778, framerate: { max: 30 }, facingmode: { exact: "user" } }; mytrack.applyconstraints(constraints).then(function() => { /* do stuff if constraints applied successfully */ }).catch(function(reason) { /*
failed to apply constraints; reason is why */ }); } here, after ensuring that the constrainable properties for which matches must be found are supported (width, height, framerate, and facingmode), we set up constraints which request a width no smaller than 640 and no larger than 1920 (but preferably 1920), a height no smaller than 400 (but ideally 1080), an aspect ratio of 16:9 (1.777777778), and a ...
Screen.lockOrientation() - Web APIs
examples usage with a domstring argument screen.lockorientationuniversal = screen.lockorientation || screen.mozlockorientation || screen.mslockorientation; if (screen.lockorientationuniversal("landscape-primary")) { // orientation was locked } else { // orientation lock
failed } usage with an array argument screen.lockorientationuniversal = screen.lockorientation || screen.mozlockorientation || screen.mslockorientation; if (screen.lockorientationuniversal(["landscape-primary", "landscape-secondary"])) { // orientation was locked } else { // orientation lock
failed } specifications specification status comment screen orientation api...
Screen.unlockOrientation() - Web APIs
example var unlockorientation = screen.unlockorientation || screen.mozunlockorientation || screen.msunlockorientation || (screen.orientation && screen.orientation.unlock); if (unlockorientation()) { // orientation was unlocked } else { // orientation unlock
failed } specifications specification status comment screen orientation apithe definition of 'lockorientation()' in that specification.
Using server-sent events - Web APIs
you can take action on this programmatically by implementing the onerror callback on the eventsource object: evtsource.onerror = 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.
ServiceWorkerContainer - Web APIs
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
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
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.unregister() - Web APIs
y unregisters it again: if ('serviceworker' in navigator) { navigator.serviceworker.register('/sw-test/sw.js', {scope: 'sw-test'}).then(function(registration) { // registration worked console.log('registration succeeded.'); registration.unregister().then(function(boolean) { // if boolean = true, unregister is successful }); }).catch(function(error) { // registration
failed console.log('registration
failed with ' + error); }); }; specifications specification status comment service workersthe definition of 'serviceworkerregistration.unregister()' in that specification.
ServiceWorkerRegistration.update() - Web APIs
tton so you can explicitly update the service worker whenever desired: if ('serviceworker' in navigator) { navigator.serviceworker.register('/sw-test/sw.js', {scope: 'sw-test'}).then(function(registration) { // registration worked console.log('registration succeeded.'); button.onclick = function() { registration.update(); } }).catch(function(error) { // registration
failed console.log('registration
failed with ' + error); }); }; specifications specification status comment service workersthe definition of 'serviceworkerregistration.update()' in that specification.
ServiceWorkerRegistration - Web APIs
var installingworker = registration.installing; console.log('a new service worker is being installed:', installingworker); // you can listen for changes to the installing service worker's // state via installingworker.onstatechange }); }) .catch(function(error) { console.log('service worker registration
failed:', error); }); } else { console.log('service workers are not supported.'); } specifications specification status comment service workersthe definition of 'serviceworkerregistration' in that specification.
ValidityState - Web APIs
properties for each of these boolean properties, a value of true indicates that the specified reason validation may have
failed is true, with the exception of the valid property, which is true if the element's value obeys all constraints.
WebGLContextEvent.statusMessage - Web APIs
var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextcreationerror', 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.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: aborterror switching the context over to the webxr-compatible context
failed.
WebGLRenderingContext - Web APIs
bytagname("canvas")[0], secondcanvas = document.getelementsbytagname("canvas")[1]; firstcanvas.width = firstcanvas.clientwidth; firstcanvas.height = firstcanvas.clientheight; [firstcanvas, secondcanvas].foreach(function(canvas) { var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { document.queryselector("p").innerhtml = "
failed to get webgl context.
Basic scissoring - Web APIs
canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { paragraph.innerhtml = "
failed to get webgl context.
Boilerplate 1 - Web APIs
ize : inherit; margin : auto; padding : 0.6em; } javascript function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "
failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } the source code of this example is also available on github.
Canvas size and WebGL - Web APIs
bytagname("canvas")[0], secondcanvas = document.getelementsbytagname("canvas")[1]; firstcanvas.width = firstcanvas.clientwidth; firstcanvas.height = firstcanvas.clientheight; [firstcanvas, secondcanvas].foreach(function(canvas) { var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { document.queryselector("p").innerhtml = "
failed to get webgl context.
Color masking - Web APIs
green; } #blue-toggle { background-color : blue; } window.addeventlistener("load", function setupanimation (evt) { "use strict" window.removeeventlistener(evt.type, setupanimation, false); var canvas = document.queryselector("canvas"); var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { document.queryselector("p").innerhtml = "
failed to get webgl context." + "your browser or device may not support webgl."; return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); var timer = setinterval(drawanimation, 1000); var mask = [true, true, true]; var redtoggle = document.queryselector("#red-toggle"), greentoggle = document.queryselector("#green-toggle"), bluetoggle = document.querys...
Detect WebGL - Web APIs
your browser supports webgl."; } else { paragraph.innerhtml = "
failed to get webgl context.
Hello GLSL - Web APIs
letebuffer(buffer); if (program) gl.deleteprogram(program); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "
failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
Hello vertex attributes - Web APIs
buffer(buffer); if (program) gl.deleteprogram(program); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "
failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
Raining rectangles - Web APIs
return [math.random(), math.random(), math.random()]; } } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "
failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
Scissor animation - Web APIs
r() { return [math.random(), math.random(), math.random()]; } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "
failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
Simple color animation - Web APIs
stopanimation({type: "click"}); var gl; function drawanimation () { if (!gl) { var canvas = document.getelementbyid("canvas-view"); gl = canvas.getcontext("webgl") ||canvas.getcontext("experimental-webgl"); if (!gl) { clearinterval(timer); alert("
failed to get webgl context.\n" + "your browser or device may not support webgl."); return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); } // get a random color value using a helper function.
Textures from code - Web APIs
letebuffer(buffer); if (program) gl.deleteprogram(program); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "
failed to get webgl context." + "your browser or device may not support webgl."; return null; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
WebGL constants - Web APIs
sync_condition 0x9113 sync_status 0x9114 sync_flags 0x9115 sync_fence 0x9116 sync_gpu_commands_complete 0x9117 unsignaled 0x9118 signaled 0x9119 already_signaled 0x911a timeout_expired 0x911b condition_satisfied 0x911c wait_
failed 0x911d sync_flush_commands_bit 0x00000001 miscellaneous constants constant name value description color 0x1800 depth 0x1801 stencil 0x1802 min 0x8007 max 0x8008 depth_component24 0x81a6 stream_read 0x88e1 stream_copy ...