From e3535538352212e3effbfa3517c86cc812f28c88 Mon Sep 17 00:00:00 2001 From: David Wendt Date: Sun, 28 Aug 2022 14:55:13 -0400 Subject: [PATCH] core: When reporting errors in the AVM2 constructor from MovieClip, also report the name of the class being constructed. --- core/src/display_object/movie_clip.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/display_object/movie_clip.rs b/core/src/display_object/movie_clip.rs index 9ae476701..01fd32ec3 100644 --- a/core/src/display_object/movie_clip.rs +++ b/core/src/display_object/movie_clip.rs @@ -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()) + ); } } }