Skip to content

Commit

Permalink
do not retry ExitErrors in ui.retryStep
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 committed Nov 22, 2024
1 parent 0dded2d commit f9a6833
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 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,11 @@ export async function retryStep<T>(
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) {
Expand Down

0 comments on commit f9a6833

Please sign in to comment.