Skip to content

Commit b6e7734

Browse files
fix(local): show outermost exception for chained errors
exception.values is ordered oldest→newest per the Sentry protocol, so values[0] is the root cause. Use .at(-1) to display the outermost exception, matching Sentry UI and Spotlight behavior.
1 parent 6676aea commit b6e7734

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/commands/local.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,8 @@ function formatErrorItem(
357357
}[];
358358
}
359359
| undefined;
360-
const first = exception?.values?.[0];
360+
// values is ordered oldest→newest; show the outermost (last) exception
361+
const first = exception?.values?.at(-1);
361362
const errorType = stripAnsi(first?.type ?? "Error");
362363
const errorValue = stripAnsi(
363364
first?.value ?? (event.message as string | undefined) ?? "Unknown error"

0 commit comments

Comments
 (0)