Skip to content

Commit 276e2cf

Browse files
committed
Ensure full stack traces are included in log messages
Pass in the `fullMessage` to `internalShowAndLog` so that stack traces aren't truncated.
1 parent e9552df commit 276e2cf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

extensions/ql-vscode/src/common/vscode/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export function registerCommandWithErrorHandling(
4949
const errorMessage = redactableError(error)`${
5050
getErrorMessage(e) || e
5151
} (${commandId})`;
52-
const errorStack = getErrorStack(e);
5352
if (e instanceof UserCancellationException) {
5453
// User has cancelled this action manually
5554
if (e.silent) {
@@ -61,6 +60,7 @@ export function registerCommandWithErrorHandling(
6160
}
6261
} else {
6362
// Include the full stack in the error log only.
63+
const errorStack = getErrorStack(e);
6464
const fullMessage = errorStack
6565
? `${errorMessage.fullMessage}\n${errorStack}`
6666
: errorMessage.fullMessage;

extensions/ql-vscode/src/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export async function showAndLogErrorMessage(
9898
return internalShowAndLog(
9999
dropLinesExceptInitial(message),
100100
Window.showErrorMessage,
101-
options,
101+
{ fullMessage: message, ...options },
102102
);
103103
}
104104

0 commit comments

Comments
 (0)