Opened 9 years ago

Closed 6 years ago

#12163 closed defect (patchwelcome)

Handle 404 errors in ThumbnailPicker

Reported by: mtyson Owned by: Shane O'Sullivan
Priority: high Milestone: 1.9
Component: Dojox Version: 1.6.0b1
Keywords: thumbnailpicker Cc: dante
Blocked By: Blocking:

Description

From the dojo interest list:

mtyson: I am populating the URLs for a dojox.image.ThumbnailPicker? from a source that sometimes gives bad urls (ie, a few of them will sometimes be 404 errors, or the like). In these cases, the picker just stops working, and loads no images at all.

Any way to make it more tolerant of the bad URLs an continue to function with the urls that are good?

shane:

You could add the following code to the _loadImage function, beneath the connect for onload

dojo.connect(img, "onerror", this, dojo.hitch(this, function(){

if(store != this.imageStore){

return false;

} this.resize();

Have to use a timeout here to prevent a call stack that gets so deep that IE throws stack overflow errors setTimeout(callback, 0); return false;

}));

Which should solve the issue, though it'll show an empty image.

Change History (2)

comment:1 Changed 9 years ago by bill

Cc: dante added; shaneosullivan1@… removed
Component: GeneralDojox
Owner: changed from anonymous to Shane O'Sullivan

Not sure who "owns" ThumbnailPicker now, maybe Shane or Peter, although no one has touched it for over a year.

comment:2 Changed 6 years ago by dylan

Milestone: tbd1.9
Resolution: patchwelcome
Status: newclosed

We would welcome a patch to fix this issue.

Note: See TracTickets for help on using tickets.