core: When reporting errors in the AVM2 constructor from MovieClip, also report the name of the class being constructed.

This commit is contained in:
David Wendt 2022-08-28 14:55:13 -04:00 committed by kmeisthax
parent 4de46562ca
commit e353553835
1 changed files with 8 additions and 1 deletions

View File

@ -1836,7 +1836,14 @@ impl<'gc> MovieClip<'gc> {
let result: Result<(), Avm2Error> = constr_thing();
if let Err(e) = result {
log::error!("Got {} when constructing AVM2 side of movie clip", e);
log::error!(
"Got {} when constructing AVM2 side of movie clip of type {}",
e,
class_object
.try_inner_class_definition()
.map(|c| c.read().name().to_qualified_name(context.gc_context))
.unwrap_or_else(|_| "[BorrowError!]".into())
);
}
}
}