Huh, the rustler::Error error type apparently doesn't implement the Error trait from std. Maybe it's for errors that are meant to be returned to erlang instead of to Rust?
Earlier, you also alluded to writing my own function to map between those different errors.
Still looking how to do the translation.
EDIT: @alice I hit a new user posting limit. Here's what I tried to reply to your comment below:
I got a bit disoriented. In this particular case I have to pattern-match on all 4 enum variants of rustler::Error and just return Erlang string or atom depending.
Thanks in part to intense back-and-forth session with @OvermindDL1 who, besides providing a PR, also provided a lot of extra explanations on top of what @alice did, the initial phase of the project is now a success: