Skip to content

Commit

Permalink
doc: fix AbortError example for timers
Browse files Browse the repository at this point in the history
PR-URL: #37738
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Zijian Liu <[email protected]>
Reviewed-By: Pooja D P <[email protected]>
  • Loading branch information
dbachko authored and ruyadorno committed Mar 24, 2021
1 parent 50f3ad1 commit c4183bb
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 c4183bb

Please sign in to comment.