Skip to content

Axios errors are not handled anymore #1617

@AlexisSouquiere

Description

@AlexisSouquiere

In #1601, axios validateStatus has been set to true for all the requests (see here) which means that all the HTTP codes shouldn't throw an error (even 4xx, 5xx).

It means that the common errors management doesn't work anymore because errors won't go through the axios.catch() and then to handleError in api.js (displaying toast warns or errors). Response will go thought .then() like if the request succeded (like this).

Moreover I saw an issue that prevented 401 errors to redirect to the login page (see here). err.status should be err.response.status

I will provide a fix quickly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions