Post
Topic
Board Development & Technical Discussion
Merits 4 from 2 users
Re: Bitcoin brainwallet implementation in Rust
by
programmer-frank
on 06/11/2021, 03:59:56 UTC
⭐ Merited by pooya87 (2) ,Welsh (2)
You are right, I should probably print a nice error message in case of this error. But it wouldn't crash, at least not in the way C++ crashes with segfaults or undefined behavior. unwrap creates a controlled panic, and unrolls the stack, same like an exception, and then prints the panic on the console (with call stack in debug mode, and if you set an environment variable for it).

Do you have a test case which creates this error? The BitAddress website uses the same function, but looks like it doesn't handle such errors either.