Open lorenzos opened 8 years ago
Maybe onerror
could call onFailure
.
If we keep it like it is it should at least be documented.
Not sure about firing 'failure'
, docs says it is for when the request failed (error status code), here we aren't dealing with a failed request, but more likely with an unexpected response (i.e. not JSON).
IMHO the three possible options are, in order of my preference:
Request.JSON
line 39 with this.fireEvent('complete').fireEvent('error', [text, error]);
.'complete'
is not fired in case of successful request but parsing error. I'm ok with #1
and #2
:) lets wait for what others say.
(sorry, I accidentally clicked the wrong button)
When
Request.JSON
fails because response cannot be correctly parsed, the'error'
event is fired.'error'
is not an event inherit fromRequest
, and is fired here:Shouldn't it fire also the
'complete'
event? I use'complete'
, for example, to hide progress indicators (like spinners), and for me the request is completed in case of errors too. Maybe my assumption is wrong, but then why the'failure'
event does it my way instead?