mirror of
https://github.com/penpot/penpot.git
synced 2025-07-20 21:37:12 +02:00
🔧 Log error on process animation frame (#6182)
This commit is contained in:
parent
d0d118b31e
commit
76ffc2d268
1 changed files with 17 additions and 4 deletions
|
@ -95,11 +95,24 @@ pub extern "C" fn render(timestamp: i32) {
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn process_animation_frame(timestamp: i32) {
|
pub extern "C" fn process_animation_frame(timestamp: i32) {
|
||||||
|
let result = std::panic::catch_unwind(|| {
|
||||||
with_state!(state, {
|
with_state!(state, {
|
||||||
state
|
state
|
||||||
.process_animation_frame(timestamp)
|
.process_animation_frame(timestamp)
|
||||||
.expect("Error processing animation frame");
|
.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]
|
#[no_mangle]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue