Skip to content

Ajax response with status 0 must throw an error #3606

@eltiodelsofa

Description

@eltiodelsofa

If ajax observable has parameter timeout configured, with a slow request, ajax is emitting a next instead of an error.

RxJS version:
6.0.0

Code to reproduce:

ajax({
  url: 'https://reqres.in/api/users?delay=5',
  timeout: 500,
}).subscribe({
  next: v => console.log('next', v),
  error: err => console.log('err', err),
});

Expected behavior:

Emit an error event with an AjaxError object

Actual behavior:

Emit a next event with ajax null response and status 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions