#![feature(backtrace)] use desert::{FromBytesBE,Error}; fn run() -> Result<(),Error> { let (_,n) = u32::from_bytes_be(&[1,2,3])?; println!["n={}", &n]; Ok(()) } fn main() -> () { if let Err(e) = run() { match e.backtrace() { Some(bt) => match bt.status() { std::backtrace::BacktraceStatus::Captured => eprintln!["{}\n\n{}", e, bt], _ => eprintln!["{}", e], }, None => eprintln!["{}", e], } } }