Bug Tracker

Opened 9 years ago

Closed 9 years ago

#15131 closed bug (wontfix)

responseXXX not populated if status is not success

Reported by: octplane Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.1
Keywords: Cc: octplane
Blocked by: Blocking:

Description

As per https://github.com/jquery/jquery/blame/d41e81980ea89e56c04eb14d8c27f4692b367604/src/ajax.js#L221 It seems that the dataType converters are not called when isSuccess is false

isSuccess = status >= 200 && status < 300
status === 304;

This means that it's not possible to rely on jQuery dataType automatic decoding if it's not a success response. Is there a reason why is this so ? Our "REST" implementation uses HTTP status code to convey the global success/failure of the request, and we also use a payload to describe precisely the status when possible.

Change History (3)

comment:1 Changed 9 years ago by dmethvin

Cc: octplane added

This was originally reportd by octplane and accidentally deleted.

comment:2 Changed 9 years ago by scottgonzalez

Reporter: changed from dmethvin to octplane

comment:3 Changed 9 years ago by dmethvin

Resolution: wontfix
Status: newclosed

We're planning a new $.xhr API that would be better suited for something like this. You can still deal with this via $.ajax if you do the conversions yourself, and we don't want to risk compatibility issues.

Note: See TracTickets for help on using tickets.