From 773cb2725fb2ef8cb8a4bce25594a61e311876c6 Mon Sep 17 00:00:00 2001 From: Roni Dover Date: Sun, 2 Jan 2022 09:32:14 -0800 Subject: [PATCH] updated code to support array of stacks for nested exceptions --- src/analyticsProvider.ts | 7 ++++++- src/views/errorFlowStackView.ts | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/analyticsProvider.ts b/src/analyticsProvider.ts index e8e7d5e..953c04b 100644 --- a/src/analyticsProvider.ts +++ b/src/analyticsProvider.ts @@ -10,6 +10,11 @@ export enum Impact LOW = "Low", } +export interface IErrorFlowStack{ + exceptionType: string; + frames: IErrorFlowFrame[]; +} + export interface IErrorFlowFrame{ moduleName: string; functionName: string; @@ -24,7 +29,7 @@ export interface IErrorFlowResponse stackTrace: string; exceptionMessage: string; exceptionType: string; - frames: IErrorFlowFrame[]; + frameStacks: IErrorFlowStack[]; } export interface IErrorFlowSummary diff --git a/src/views/errorFlowStackView.ts b/src/views/errorFlowStackView.ts index bd95688..6e34593 100644 --- a/src/views/errorFlowStackView.ts +++ b/src/views/errorFlowStackView.ts @@ -98,9 +98,13 @@ class ErrorFlowDetailsViewProvider implements vscode.WebviewViewProvider, vscode private getHtml(errorFlow: IErrorFlowResponse | undefined, originCodeObjectId: string | undefined) : string { - const framesHtml = errorFlow?.frames.reverse() + + const framesHtml = errorFlow?.frameStacks.flatMap(f=> f.frames).reverse() .map(f => this.getFrameItemHtml(f, originCodeObjectId!)) .join('') ?? ''; + // const framesHtml = errorFlow?.frameStacks[0].frames.reverse() + // .map(f => this.getFrameItemHtml(f, originCodeObjectId!)) + // .join('') ?? ''; const checked = Settings.hideFramesOutsideWorkspace ? "checked" : ""; return /*html*/ `