From 92ae0b8f8ba439f32d8167a3877e87f9bf817d03 Mon Sep 17 00:00:00 2001 From: teg-atlassian Date: Fri, 23 Jan 2026 19:12:34 -0800 Subject: [PATCH] standardized errors for unhandled exceptions --- src/extension.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index d990c5118..b4d01131a 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -44,12 +44,11 @@ export async function activate(context: ExtensionContext) { // Register global error handlers as last resort to catch any unhandled exceptions const uncaughtExceptionHandler = (error: Error) => { - Logger.error(error, 'Uncaught exception in extension'); + Logger.error(new Error('Uncaught exception in extension'), String(error)); }; const unhandledRejectionHandler = (reason: any) => { - const error = reason instanceof Error ? reason : new Error(String(reason)); - Logger.error(error, 'Unhandled promise rejection in extension'); + Logger.error(new Error('Unhandled promise rejection in extension'), String(reason)); }; process.on('uncaughtException', uncaughtExceptionHandler);