handle errors
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.8k
- Forks
- 7.9k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
The React team believes that server-side errors should be handled in the second then argument. But if an error occurs (an error in our logic) in the first argument of then, it will not be caught. So you think that logic errors should be caught elsewhere (maybe Error Boundary)?

fetch('https://jsonplaceholder.typicode.com/todos/1')
.then(response => response.json())
.then(json => {
console.log(json)
throw new Error('myError') // <= Error here
},
(error) => {
console.log(error) // <= do not work
}).catch(error => console.log(error)) // <= work
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the fetch example in the issue and compare the second then argument with catch and React Error Boundaries. Confirm how errors thrown in the first callback propagate, then identify the relevant React documentation page and define the issue as resolved once the guidance clearly explains where each kind of error is handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100