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 <raisinten@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
  • 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.