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 targos committed May 1, 2021
1 parent 14a160a commit a27534e
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 @@ -264,7 +264,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 @@ -283,7 +283,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 a27534e

Please sign in to comment.