Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#17349 closed defect (fixed)

use console.error() when domReady callback fails

Reported by: bill Owned by: Kris Zyp <kriszyp@…>
Priority: undecided Milestone: 1.9.4
Component: Core Version: 1.9.1
Keywords: Cc:
Blocked By: Blocking:

Description

From the dojo-interest mailing list:

There's a small bug in domReady module (1.9.1).

domReady executes the queue in try..catch block:

while(readyQ.length){
	try{
		(readyQ.shift())(doc);
	}catch(err){
		console.log("Error on domReady callback: " + err);
	}
}

There's used console.log instead of console.error. But dojo built with shrinkSafe's parameter stripConsole=normal So this code:

require(["dojo/domReady!"], function(){
       	throw new Error("ready");
});

will not write any error message.

Please replace console.log to console.error in the future release.

Change History (6)

comment:1 Changed 6 years ago by danlobo

Why not just leave the error unhandled at this part? This way we can handle the error later.

A suggestion is written below:

from: (dojo/domReady.js:36-46)

recursiveGuard = true;

while(readyQ.length){
	try{
		(readyQ.shift())(doc);
	}catch(err){
		console.log("Error on domReady callback: " + err);
	}
}

recursiveGuard = false;

to:

recursiveGuard = true;

try {
	while(readyQ.length){
		(readyQ.shift())(doc);
	}
}
finally {
	recursiveGuard = false;
}

comment:2 Changed 5 years ago by Kris Zyp <kriszyp@…>

Owner: set to Kris Zyp <kriszyp@…>
Resolution: fixed
Status: newclosed

In d8f2e7b1665e016d06d6c97a1de6156efc3db8c6/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:3 Changed 5 years ago by Kris Zyp

Milestone: tbd1.11

comment:4 Changed 5 years ago by Kris Zyp <kriszyp@…>

In 7eda7c1a401018c96261bedef7ac9fe9087d22c2/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:5 Changed 5 years ago by Kris Zyp <kriszyp@…>

In 1bfedcaa8c2fd2d7cee22f45ad865b57b5568782/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:6 Changed 5 years ago by bill

Milestone: 1.111.9.4
Note: See TracTickets for help on using tickets.