From f9a6833838ae68a09a42ed4098c73d62a115b8fe Mon Sep 17 00:00:00 2001 From: Hugh Cunningham Date: Fri, 22 Nov 2024 12:42:33 -0800 Subject: [PATCH] do not retry ExitErrors in ui.retryStep 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ironfish-cli/src/ui/retry.ts b/ironfish-cli/src/ui/retry.ts index addc2038eb..0ad33bc9ca 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,11 @@ export async function retryStep( const result = await stepFunction() return result } catch (error) { + // do not ask to retry if exiting + if (error instanceof ExitError) { + throw error + } + logger.log(`An Error Occurred: ${ErrorUtils.renderError(error)}`) if (askToRetry) {