web: Use PanicInfo::to_string for displaying panic info

PanicInfo::payload wasn't giving anything useful (just resulted
in 'Unknown error') -- to_string displays all of the message,
payload, and location of the panic. Particularly the location
is helpful.
This commit is contained in:
Mike Welsh 2020-10-11 00:48:08 -07:00
parent 2c9cf6802d
commit 4034ef8d79
1 changed files with 1 additions and 5 deletions

View File

@ -875,11 +875,7 @@ pub fn set_panic_handler() {
RUFFLE_GLOBAL_PANIC.call_once(|| {
console_error_panic_hook::hook(info);
let error = JsError::new(
info.payload()
.downcast_ref::<&str>()
.unwrap_or(&"Unknown panic"),
);
let error = JsError::new(&info.to_string());
let _ = INSTANCES.try_with(|instances| {
let mut players = Vec::new();