Skip to content

Commit

Permalink
do not retry ExitErrors in ui.retryStep (#5668)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hughy authored Nov 25, 2024
1 parent 750cdf1 commit 6bdd3ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ironfish-cli/src/ui/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(
Expand All @@ -18,6 +19,10 @@ export async function retryStep<T>(
const result = await stepFunction()
return result
} catch (error) {
if (error instanceof ExitError) {
throw error
}

logger.log(`An Error Occurred: ${ErrorUtils.renderError(error)}`)

if (askToRetry) {
Expand Down

0 comments on commit 6bdd3ec

Please sign in to comment.