From 016064d7ea1fe8152283c45e7678c90c11d7bd25 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 6 Mar 2024 12:10:19 +1100 Subject: [PATCH] Logging in case of failures --- src/platform/common/application/extensions.node.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/platform/common/application/extensions.node.ts b/src/platform/common/application/extensions.node.ts index dc563d5f99e..ecd116a27fe 100644 --- a/src/platform/common/application/extensions.node.ts +++ b/src/platform/common/application/extensions.node.ts @@ -25,12 +25,10 @@ export class Extensions implements IExtensions { public determineExtensionFromCallStack(stack?: string): { extensionId: string; displayName: string } { stack = stack || new Error().stack; try { + const jupyterExtRoot = extensions.getExtension(JVSC_EXTENSION_ID)!.extensionUri.toString().toLowerCase(); + let frames: string[] = []; if (stack) { - const jupyterExtRoot = extensions - .getExtension(JVSC_EXTENSION_ID)! - .extensionUri.toString() - .toLowerCase(); - const frames = stack + frames = stack .split('\n') .map((f) => { const result = /\((.*)\)/.exec(f); @@ -104,7 +102,9 @@ export class Extensions implements IExtensions { } } } - traceError(`Unable to determine the caller of the extension API for trace stack.`, stack); + traceError(`Unable to determine the caller of the extension API for trace stack`, stack); + traceError(`Jupyter Root`, jupyterExtRoot); + traceError(`Frames`, frames); return { extensionId: unknownExtensionId, displayName: DataScience.unknownPackage }; } catch (ex) { traceError(`Unable to determine the caller of the extension API for trace stack.`, stack);