solders icon indicating copy to clipboard operation
solders copied to clipboard

Panic output can't be prevented

Open krruzic opened this issue 9 months ago • 0 comments

Not sure how to title this. My code looks like this:

from solders.keypair import Keypair
try:
    Keypair.from_base58_string("test")
except:
    print("Invalid keypair")

Output:

called `Result::unwrap()` on an `Err` value: signature::Error { source: Some(candidate keypair byte array is too short) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Invalid keypair

I expect only my print statement to be outputted, but the rust panic prints are still printed. I've tried redirecting stderr too.

krruzic avatar Apr 30 '24 00:04 krruzic