Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
Improve error handling and logging in renderer
Richie McIlroy8f71c7dddb7b
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rsindex 200775522..012869016 100644--- a/crates/editor/src/editor.rs+++ b/crates/editor/src/editor.rs@@ -46,7 +46,6 @@ impl Renderer {)?);let mut max_duration = recordings.duration();- // Check camera duration if it existsif let Some(camera_path) = meta.camera_path()&& let Ok(camera_duration) =recordings.get_source_duration(&recording_meta.path(&camera_path))@@ -143,7 +142,7 @@ impl Renderer {break;}}- let frame = frame_renderer+ match frame_renderer.render(current.segment_frames,current.uniforms,@@ -151,8 +150,14 @@ impl Renderer {&mut layers,).await- .unwrap();- (self.frame_cb)(frame);+ {+ Ok(frame) => {+ (self.frame_cb)(frame);+ }+ Err(e) => {+ tracing::error!(error = %e, "Failed to render frame in editor");+ }+ }let _ = current.finished.send(());}@@ -182,7 +187,6 @@ impl RendererHandle {}pub async fn stop(&self) {- // Send a stop message to the rendererlet (tx, rx) = oneshot::channel();if self.tx@@ -190,9 +194,8 @@ impl RendererHandle {.await.is_err(){- println!("Failed to send stop message to renderer");+ tracing::warn!("Failed to send stop message to renderer");}- // Wait for the renderer to acknowledge the stoplet _ = rx.await;}}