You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Request.JSON fails because response cannot be correctly parsed, the 'error' event is fired. 'error' is not an event inherit from Request, 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?
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:
Modify Request.JSON line 39 with this.fireEvent('complete').fireEvent('error', [text, error]);.
Fix documentation, specifying 'complete' is not fired in case of successful request but parsing error.
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?Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: