X Tutup
Skip to content

XHR does not treat 4xx responses as errors #5130

@escardin

Description

@escardin

When my server returns a 400 response with text, the xhr backend does not route this through to the error observer, and instead calls the success path.

I am porting a service from angular 1 to angular 2, and this was not a problem in angular 1, nor is it a problem with rxjs-dom, which I am using in the meantime.

Affected area:
https://github.com/angular/angular/blob/master/modules/angular2/src/http/backends/xhr_backend.ts#L41

What rxjs-dom does and I think angular 2 should do similarly:
https://github.com/Reactive-Extensions/RxJS-DOM/blob/master/src/ajax/ajax.js#L76

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup