Skip to content

Unreachable log info of frame_try_runtime::TryRuntime #362

@Chralt98

Description

@Chralt98

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions