graceful-none-twice.js
This file
Path
test/fixtures/graceful-none-twice.js
14 lines · 527 bytes · JavaScript
Last changed by
TweaksSindre Sorhusbefore adoption698a1b8
History of this fileTake it
Harden some thingsSindre Sorhusbefore adoption4a0a121
lines 1–5why, one step back1#!/usr/bin/env node2import process from 'node:process';3import {getCancelSignal} from 'execa';45// Each call must throw the same error, including when the first one is caught and retriedTweaksSindre Sorhusbefore adoption698a1b8
line 6why, one step back6// The calls are sequential on purpose, so the second one is retried after the first one was caughtHarden some thingsSindre Sorhusbefore adoption4a0a121
lines 7–8why, one step back7for (let index = 0; index < 2; index++) {8 try {TweaksSindre Sorhusbefore adoption698a1b8
line 9why, one step back9 // eslint-disable-next-line no-await-in-loop -- the second call is retried only after the first one was caughtHarden some thingsSindre Sorhusbefore adoption4a0a121
lines 10–14why, one step back10 await getCancelSignal();11 } catch {12 process.stdout.write('threw\n');13 }14}