In development, my code uses .expect()
and panic!()
to handle fatal errors.
Their behaviour is exactly what I need during development.
When I compile with --release
, I was hoping that their output would become more succinct.
i.e. This code:
let mut file_a = OpenOptions::new().write(true)
.read(true)
.open(args.file_a).expect("foo bar");
generates:
thread 'main' panicked at 'foo bar: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/bin/vsapply.rs:131:59
When I would prefer just:
foo bar: No such file or directory
when compiled with --release
.
Is there already a way of doing this?