From 76856c3bb025a9368985656b65c77deccfebc863 Mon Sep 17 00:00:00 2001 From: ysdede <5496750+ysdede@users.noreply.github.com> Date: Sat, 7 Feb 2026 19:00:35 +0000 Subject: [PATCH 1/2] Refactor error handling in App.tsx to avoid unsafe 'any' usage Replaces `catch (err: any)` with `catch (err)` in two locations in `src/App.tsx`. Implements safe error message extraction by checking `err instanceof Error` before accessing `.message`. Uses `String(err)` as a fallback for non-Error thrown objects. This improves type safety and robustness of the application's error reporting. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- src/App.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 5b3e1a9..96c6aa3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -389,7 +389,7 @@ const App: Component = () => { modelConfidence: 0, }); } - } catch (err: any) { + } catch (err) { console.error('[v4Tick] Inference error:', err); } finally { v4InferenceBusy = false; @@ -718,8 +718,9 @@ const App: Component = () => { } } }, 100); - } catch (err: any) { - appStore.setErrorMessage(err.message); + } catch (err) { + const message = err instanceof Error ? err.message : String(err); + appStore.setErrorMessage(message); } } }; From 652c2e789b308ce84302d2a90097e4e31a722f30 Mon Sep 17 00:00:00 2001 From: ysdede <5496750+ysdede@users.noreply.github.com> Date: Tue, 10 Feb 2026 21:48:29 +0000 Subject: [PATCH 2/2] Refactor error handling in App.tsx to avoid unsafe 'any' usage Replaces `catch (err: any)` with `catch (err)` in two locations in `src/App.tsx`. Implements safe error message extraction by checking `err instanceof Error` before accessing `.message`. Uses `String(err)` as a fallback for non-Error thrown objects. This improves type safety and robustness of the application's error reporting. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>