Opened 10 years ago
Closed 8 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 10 years ago by
Cc: | dante added; shaneosulliva[email protected]… removed |
---|---|
Component: | General → Dojox |
Owner: | changed from anonymous to Shane O'Sullivan |
comment:2 Changed 8 years ago by
Milestone: | tbd → 1.9 |
---|---|
Resolution: | → patchwelcome |
Status: | new → closed |
We would welcome a patch to fix this issue.
Not sure who "owns" ThumbnailPicker now, maybe Shane or Peter, although no one has touched it for over a year.