0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-14 07:51:35 -05:00

🔧 Log error on process animation frame (#6182)

This commit is contained in:
Elena Torró 2025-04-01 09:01:49 +02:00 committed by GitHub
parent d0d118b31e
commit 76ffc2d268
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -95,11 +95,24 @@ pub extern "C" fn render(timestamp: i32) {
#[no_mangle]
pub extern "C" fn process_animation_frame(timestamp: i32) {
with_state!(state, {
state
.process_animation_frame(timestamp)
.expect("Error processing animation frame");
let result = std::panic::catch_unwind(|| {
with_state!(state, {
state
.process_animation_frame(timestamp)
.expect("Error processing animation frame");
});
});
match result {
Ok(_) => {}
Err(err) => {
match err.downcast_ref::<String>() {
Some(message) => println!("process_animation_frame error: {}", message),
None => println!("process_animation_frame error: {:?}", err),
}
std::panic::resume_unwind(err);
}
}
}
#[no_mangle]