Skip to content

Commit

Permalink
Fixes AbortError example for timers
Browse files Browse the repository at this point in the history
  • Loading branch information
dbachko committed Mar 13, 2021
1 parent bfa6e37 commit 9bf6d06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/api/timers.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ const signal = ac.signal;
setImmediatePromise('foobar', { signal })
.then(console.log)
.catch((err) => {
if (err.message === 'AbortError')
if (err.name === 'AbortError')
console.log('The immediate was aborted');
});

Expand All @@ -285,7 +285,7 @@ const signal = ac.signal;
setTimeoutPromise(1000, 'foobar', { signal })
.then(console.log)
.catch((err) => {
if (err.message === 'AbortError')
if (err.name === 'AbortError')
console.log('The timeout was aborted');
});

Expand Down

0 comments on commit 9bf6d06

Please sign in to comment.