tomfumb

Bug? IdentifyTask onError callback only seems to recognise timeouts, not other errors

Discussion created by tomfumb on Oct 9, 2012
I've just moved to version 3.2 of the JavaScript API and implemented an IdentifyTask with an error callback.

I'm using Fiddler to trap requests to my map server, then manually changing their response code from 200 to 500, 401 etc - anything that should be seen as an error by my application.

The problem is the error callback is never called in response to these error responses. I know the 500 response gets to the browser because it gets logged as an error in Chrome's console. Instead the error callback is called some time later after a Dojo 'timeout' error. It seems real error responses are being ignored and the only error handling is for timeouts.

Is this a bug in the API or am I doing / expecting something incorrect?

What I'm doing in code is very straightforward (see below) and I'm using Fiddler's BPU (breakpoint on URL) to catch identify requests, then clicking 'break on completion', and changing the header "HTTP/1.1 200 OK" to "HTTP/1.1 500 Internal Server Error". This is the same approach I've used many times before to simulate server errors.

identifyTask.execute(identifyParameters, lang.hitch(this, this.onIdentifyResults), lang.hitch(this, this.onIdentifyError));


The contents of the error callback is irrelevant as I'm sticking a breakpoint on the first line and waiting for it to be hit.

Thanks!

Outcomes