Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading