Ensure full stack traces are included in log messages
Pass in the `fullMessage` to `internalShowAndLog` so that stack traces aren't truncated.
This commit is contained in:
@@ -49,7 +49,6 @@ export function registerCommandWithErrorHandling(
|
||||
const errorMessage = redactableError(error)`${
|
||||
getErrorMessage(e) || e
|
||||
} (${commandId})`;
|
||||
const errorStack = getErrorStack(e);
|
||||
if (e instanceof UserCancellationException) {
|
||||
// User has cancelled this action manually
|
||||
if (e.silent) {
|
||||
@@ -61,6 +60,7 @@ export function registerCommandWithErrorHandling(
|
||||
}
|
||||
} else {
|
||||
// Include the full stack in the error log only.
|
||||
const errorStack = getErrorStack(e);
|
||||
const fullMessage = errorStack
|
||||
? `${errorMessage.fullMessage}\n${errorStack}`
|
||||
: errorMessage.fullMessage;
|
||||
|
||||
@@ -98,7 +98,7 @@ export async function showAndLogErrorMessage(
|
||||
return internalShowAndLog(
|
||||
dropLinesExceptInitial(message),
|
||||
Window.showErrorMessage,
|
||||
options,
|
||||
{ fullMessage: message, ...options },
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user