Skip to content

Commit

Permalink
Debug log CLI error if it exists (#3165)
Browse files Browse the repository at this point in the history
It's not easy to debug CLI errors from the RPC. You need to add a log
here, but it's nicer if in verbose mode this automatically happens.
  • Loading branch information
NullSoldier authored Jan 31, 2023
1 parent f02227a commit fa1380a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ironfish-cli/src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export abstract class IronfishCommand extends Command {
} catch (error: unknown) {
if (hasUserResponseError(error)) {
this.log(error.codeMessage)

if (error.codeStack) {
this.sdk.logger.debug(error.codeStack)
}
} else if (error instanceof ExitError) {
throw error
} else if (error instanceof CLIError) {
Expand Down

0 comments on commit fa1380a

Please sign in to comment.