Skip to content

Commit 33df467

Browse files
authored
feat(cast): handle invalid JSON in recover-authority without panic (#11690)
1 parent 64255f6 commit 33df467

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/cast/src/args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ pub async fn run_command(args: CastArgs) -> Result<()> {
748748
}
749749
}
750750
CastSubcommand::RecoverAuthority { auth } => {
751-
let auth: SignedAuthorization = serde_json::from_str(&auth).unwrap();
751+
let auth: SignedAuthorization = serde_json::from_str(&auth)?;
752752
sh_println!("{}", auth.recover_authority()?)?;
753753
}
754754
CastSubcommand::TxPool { command } => command.run().await?,

0 commit comments

Comments
 (0)