Getting location information from a `thiserror::Error`?

Does it need to be a std::backtrace::Backtrace, or could you use a backtrace::Backtrace?

The #[error("...")] thing uses the same syntax as format!(), so you would need to use somethnig like #[error("{source} at {}", get_function_name(backtrace))].

2 Likes