Skip to content

Unhandled exception is thrown if AjaxObservable fails to parse response #3138

@myklt

Description

@myklt

RxJS version: 5.5.2

Code to reproduce:
Please find test cases in the PR which will follow up the issue.

Expected behavior:
AjaxObservable sends an error to subscribers which could be caught using catchError operator.

Actual behavior:
If responseType is '' in response, but it was set to json in request and xhr's response or responseText is not valid JSON, the unhandled error "Invalid character" is thrown.

Additional information:
The error is reproducible with IE11 only. Once the resource is not found, there is a proxy on our server, which overtakes the response and returns HTML 404 page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions