From 6bdd3ecef8350f60892dda5da5a577650a4fe6f7 Mon Sep 17 00:00:00 2001 From: Hugh Cunningham <57735705+hughy@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:30:57 -0800 Subject: [PATCH] do not retry ExitErrors in ui.retryStep (#5668) if the command is exiting due to user action (e.g., choosing not to continue) or an un-retryable problem then we should not prompt to retry --- ironfish-cli/src/ui/retry.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ironfish-cli/src/ui/retry.ts b/ironfish-cli/src/ui/retry.ts index addc2038eb..ae948603a1 100644 --- a/ironfish-cli/src/ui/retry.ts +++ b/ironfish-cli/src/ui/retry.ts @@ -3,6 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { ErrorUtils, Logger } from '@ironfish/sdk' import { ux } from '@oclif/core' +import { ExitError } from '@oclif/core/errors' import { confirmList } from './prompt' export async function retryStep( @@ -18,6 +19,10 @@ export async function retryStep( const result = await stepFunction() return result } catch (error) { + if (error instanceof ExitError) { + throw error + } + logger.log(`An Error Occurred: ${ErrorUtils.renderError(error)}`) if (askToRetry) {