Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading the exact error the browser reports #411

Open
ghost opened this issue Jan 2, 2019 · 1 comment
Open

Reading the exact error the browser reports #411

ghost opened this issue Jan 2, 2019 · 1 comment
Milestone

Comments

@ghost
Copy link

ghost commented Jan 2, 2019

When using the API, I catch - obviously - errors with .catch(error).

The problem is that while in the browser I see a specific error message, catch reports a more generic error.

E.g: if I get in Chrome "request has been blocked by CORS policy", with catch I get "Request has been terminated, Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.".

Is there a way to read the specific error message from catch, i.e. from the error the API reports?

@kadamwhite
Copy link
Collaborator

This appears to be a function of how Superagent wraps error objects. I agree that it would be preferable to return a clearer error; this would represent a BC break so I'll add a note to the 2.0 milestone to audit our transport methods for return error clarity.

@kadamwhite kadamwhite added this to the 2.0 milestone Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant