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:
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]
|
||||
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]
|
||||
|
|
Loading…
Add table
Reference in a new issue