We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I got this fetchData method in my component:
fetchData(params, cb) { superagent .get(`${API_URL}/users/` + params.username) .accept('json') .set('Api', 'v1') .end(function(err, res) { cb(err, res && res.body); }) },
How can I display a 404 message when the superagent returns a 404 from request?
Thanks.
The text was updated successfully, but these errors were encountered:
404 is not catch here and it's not an error, you can check the res object and see the http status code, and then you can do whatever you want with it.
res
Sorry, something went wrong.
But since I'm into fetchData I need to return the cb, don't I?
Sorry if I am too lost.
No branches or pull requests
Hi, I got this fetchData method in my component:
How can I display a 404 message when the superagent returns a 404 from request?
Thanks.
The text was updated successfully, but these errors were encountered: