renames
This commit is contained in:
parent
787d58a83f
commit
455d300d8d
280 changed files with 2 additions and 2 deletions
13
6-async/03-promise-chaining/02-error-async/solution.md
Normal file
13
6-async/03-promise-chaining/02-error-async/solution.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
The answer is: **no, it won't**:
|
||||
|
||||
```js run
|
||||
new Promise(function(resolve, reject) {
|
||||
setTimeout(() => {
|
||||
throw new Error("Whoops!");
|
||||
}, 1000);
|
||||
}).catch(alert);
|
||||
```
|
||||
|
||||
As said in the chapter, there's an "implicit `try..catch`" around the function code. So all synchronous errors are handled.
|
||||
|
||||
But here the error is generated not while the executor is running, but later. So the promise can't handle it.
|
Loading…
Add table
Add a link
Reference in a new issue