Skip to content

Commit 375630b

Browse files
committed
Make minor grammar corrections/updates to async/promise-error-handling
1 parent 5b19579 commit 375630b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

1-js/11-async/04-promise-error-handling/article.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ new Promise((resolve, reject) => {
6060
new Promise((resolve, reject) => {
6161
*!*
6262
reject(new Error("Whoops!"));
63-
*/!*
63+
*/!*
6464
}).catch(alert); // Error: Whoops!
6565
```
6666

@@ -98,7 +98,7 @@ The final `.catch` not only catches explicit rejections, but also occasional err
9898

9999
As we already noticed, `.catch` at the end of the chain is similar to `try..catch`. We may have as many `.then` handlers as we want, and then use a single `.catch` at the end to handle errors in all of them.
100100

101-
In a regular `try..catch` we can analyze the error and maybe rethrow it if can't handle. The same thing is possible for promises.
101+
In a regular `try..catch` we can analyze the error and maybe rethrow it if it can't be handled. The same thing is possible for promises.
102102

103103
If we `throw` inside `.catch`, then the control goes to the next closest error handler. And if we handle the error and finish normally, then it continues to the closest successful `.then` handler.
104104

0 commit comments

Comments
 (0)