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
123456789101112131415#!/usr/bin/env nodeimport process from 'node:process';import {getCancelSignal} from 'execa';
// Each call must throw the same error, including when the first one is caught and retried// The calls are sequential on purpose, so the second one is retried after the first one was caughtfor (let index = 0; index < 2; index++) { try { // eslint-disable-next-line no-await-in-loop -- the second call is retried only after the first one was caught await getCancelSignal(); } catch { process.stdout.write('threw\n'); }}