-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
Discussed in #361
Originally posted by Chralt98 May 23, 2022
This will never get printed, if it relies on frame-executive. Because the first unwrap in try_runtime_upgrade() would lead to a panic, therefore the code stops executing and wouldn't reach the log::info from the call stack.
#![allow(unused)]
fn main() {
try_runtime_upgrade().map_err(|err| {
println!("Additional information");
err
}).unwrap();
}
fn try_runtime_upgrade() -> Result<(), &'static str> {
let x: Result<(), &'static str> = Err("fatal error").unwrap();
Ok(())
}thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "fatal error"', src/main.rs:7:58
"Additional information" never mentioned.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels