404 when resource on server not found
- Dominant language
- JavaScript
- Stars
- 138
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Find the component containing the shown fetchData method and start with the superagent .end callback. Trace how callback errors and response bodies are handled, then verify that a 404 response results in a user-visible message without breaking successful requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100