Opened 8 years ago

Closed 4 years ago

#14113 closed enhancement (patchwelcome)

dojox.form.uploader is not handling server errors, 401, 500, etc

Reported by: ldavis Owned by: dylan
Priority: high Milestone: 1.11
Component: DojoX Uploader Version: 1.6.1
Keywords: uploader server http Cc:
Blocked By: Blocking:

Description

In the event you receive a server http error code, 401, 500, etc, uploader does not handle or give you the ability to handle the exception.

It would be great if these situations could be trapped\identified, so they could then be handled.

Current observed behaviour:

The HTML5 plugin enters onComplete, but does not have any information to handle the problem.

The Flash plugin appears to hang unless you hit the timeout. It does fire the onError, but doesn't seem to let you do anything after the exception has occurred.

Change History (4)

comment:1 Changed 8 years ago by Mike Wilcox

I'll look into this, but I'm pretty sure this was already something I attempted. There are error events in Flash, but sometimes they just don't work.

comment:2 Changed 8 years ago by ldavis

With HTML5 would it be possible to check the xhr status on readystatechange to see if there is a valid http status code? I know this is an oversimplification, but would something like the following have any negative side effects?:

xhr.onreadystatechange = lang.hitch(this, function(){
   if(xhr.readyState === 4){
   //console.info("COMPLETE")
   clearInterval(timer);
   if(xhr.status != 200)
   {
      this.onError(xhr);
   }
   this.onComplete(JSON.parse(xhr.responseText.replace(/^\{\}&&/,'')));
}
});

comment:3 Changed 4 years ago by dylan

Owner: changed from Mike Wilcox to dylan
Status: newassigned

comment:4 Changed 4 years ago by dylan

Milestone: tbd1.11
Resolution: patchwelcome
Status: assignedclosed

Definitely possible, and my apologies that you've not had a response to this previously.

Given that no one has addressed this in 4 years, and we're trying to make our tickets manageable, I'm going to mark this as patchwelcome. If you want to create a pull request via github following the guidelines at ​https://github.com/dojo/dojo/blob/master/CONTRIBUTING.md , we'll review and land it.

Note: See TracTickets for help on using tickets.