From ca04b8acbad74f0b78a80fdc151c716a3eab9b9c Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 19 Jul 2026 14:15:30 +0000 Subject: [PATCH] code health: use unknown instead of any in BottomPanel catch clause Replace unsafe 'any' with 'unknown' type in debug REPL catch clause. Validate error using 'instanceof Error' before accessing 'message', with a safe fallback to 'String(err)' for non-Error catches. Co-authored-by: beingniloy <235952944+beingniloy@users.noreply.github.com> --- src/components/BottomPanel.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/BottomPanel.tsx b/src/components/BottomPanel.tsx index a53b8e2..e5b44ad 100644 --- a/src/components/BottomPanel.tsx +++ b/src/components/BottomPanel.tsx @@ -119,8 +119,9 @@ export default React.memo(function BottomPanel() { } const output = result === undefined ? 'undefined' : result === null ? 'null' : typeof result === 'object' ? JSON.stringify(result, null, 2) : String(result); setDebugLines([...newLines, { text: output, type: 'output' as const }]); - } catch (err: any) { - setDebugLines([...newLines, { text: err.message, type: 'error' as const }]); + } catch (err: unknown) { + const message = err instanceof Error ? err.message : String(err); + setDebugLines([...newLines, { text: message, type: 'error' as const }]); } setDebugInput(''); };