Opened 8 years ago

Closed 4 years ago

#12612 closed defect (wontfix)

XHR attribute "failOk" still not surpress all browser console error messages

Reported by: jacqueld Owned by: Bryan Forbes
Priority: high Milestone: 1.11
Component: IO Version: 1.6.0
Keywords: xhr failOk Cc:
Blocked By: Blocking:

Description

reference ticket : #11568

dojo version : 1.6.0 (23917)

file : dojo.js.uncompressed.js

var hostUrl = "http://localhost/a_url_to_generate_a_404";		    
var args = {failOk:false, url:hostUrl};
dojo.xhrGet(args);

This drives dojo to console log an error.

Error: Unable to load garden/xhr/get-http-response-code.php?httpCode=404 status:404 This is done at line 4039 and 10321.

If failOk:true, this is supposed to suppress console logging, but an error is still logged by line 4039.

if(!error || error.log !== false){
/* line 4039 */ (dojo.config.deferredOnError || function(x){ console.error(x); })(error);
}

This is because the error object has no error.log property.

Changing

// dojo.js.uncompressed.js - line 10486
err.responseText = xhr.responseText;
dfd.errback(err);

to

err.responseText = xhr.responseText;
err.log = !dfd.ioArgs.args.failOk;
dfd.errback(err);

seems to solve the problem.

Change History (2)

comment:1 Changed 7 years ago by bill

Component: CoreIO
Owner: set to Bryan Forbes

You can close as wontfix if this is addressed with the new dojo/request code.

comment:2 Changed 4 years ago by dylan

Milestone: tbd1.11
Resolution: wontfix
Status: newclosed

Marking as wontfix, as the mechanism with dojo/request is quite different (callback and errback handlers on the promise).

Note: See TracTickets for help on using tickets.