diff --git a/contracts/feature-tests/panic-message-features/scenarios/error-message-after-log.txt b/contracts/feature-tests/panic-message-features/scenarios/error-message-after-log.txt index 09fa24df8b..0902894d05 100644 --- a/contracts/feature-tests/panic-message-features/scenarios/error-message-after-log.txt +++ b/contracts/feature-tests/panic-message-features/scenarios/error-message-after-log.txt @@ -1 +1,2 @@ -panic occured: PanicInfo { payload: Any { .. }, message: Some(panic after log), location: Location { file: "panic_features.rs", line: 22, col: 9 }, can_unwind: true, force_no_backtrace: false } \ No newline at end of file +panic occurred: panicked at panic_features.rs:22:9: +panic after log \ No newline at end of file diff --git a/contracts/feature-tests/panic-message-features/scenarios/error-message.txt b/contracts/feature-tests/panic-message-features/scenarios/error-message.txt index 0c49fcc44d..b161bad102 100644 --- a/contracts/feature-tests/panic-message-features/scenarios/error-message.txt +++ b/contracts/feature-tests/panic-message-features/scenarios/error-message.txt @@ -1 +1,2 @@ -panic occured: PanicInfo { payload: Any { .. }, message: Some(example panic message 123), location: Location { file: "panic_features.rs", line: 22, col: 9 }, can_unwind: true, force_no_backtrace: false } \ No newline at end of file +panic occurred: panicked at panic_features.rs:15:9: +example panic message 123 \ No newline at end of file diff --git a/contracts/feature-tests/panic-message-features/tests/pmf_scenario_rs_test.rs b/contracts/feature-tests/panic-message-features/tests/pmf_scenario_rs_test.rs index 2f9355f0d1..93db854e46 100644 --- a/contracts/feature-tests/panic-message-features/tests/pmf_scenario_rs_test.rs +++ b/contracts/feature-tests/panic-message-features/tests/pmf_scenario_rs_test.rs @@ -19,6 +19,7 @@ fn panic_after_log_rs() { world().run("scenarios/panic-after-log.scen.json"); } +#[ignore = "PanicInfo currently not available, TODO: use std::panic::set_hook"] #[test] fn panic_message_rs() { world().run("scenarios/panic-message.scen.json"); diff --git a/framework/wasm-adapter/src/panic.rs b/framework/wasm-adapter/src/panic.rs index 59a9545835..bd7cb707f1 100644 --- a/framework/wasm-adapter/src/panic.rs +++ b/framework/wasm-adapter/src/panic.rs @@ -20,7 +20,7 @@ pub fn panic_fmt_with_message(panic_info: &PanicInfo) -> ! { let mut panic_msg = ManagedPanicMessage::default(); panic_msg.append_str("panic occurred: "); - core::fmt::write(&mut panic_msg, format_args!("{:?}", panic_info)) + core::fmt::write(&mut panic_msg, format_args!("{panic_info}")) .unwrap_or_else(|_| panic_msg.append_str("unable to write panic")); VmApiImpl::error_api_impl().signal_error_from_buffer(panic_msg.buffer.get_handle())