mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 16:58:55 -05:00
Co-authored-by: vs-code-engineering[bot] <122617954+vs-code-engineering[bot]@users.noreply.github.com> Co-authored-by: Michael Lively <12552271+Yoyokrazy@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
84bf6e2e10
commit
dc92e72c75
@@ -506,9 +506,16 @@ export class ExtensionError extends Error {
|
||||
readonly extension: ExtensionIdentifier;
|
||||
|
||||
constructor(extensionIdentifier: ExtensionIdentifier, cause: Error, message?: string) {
|
||||
super(`Error in extension ${ExtensionIdentifier.toKey(extensionIdentifier)}: ${message ?? cause.message}`, { cause });
|
||||
const detail = message && cause?.message ? `${message}: ${cause.message}` : (message ?? cause?.message);
|
||||
super(`Error in extension ${ExtensionIdentifier.toKey(extensionIdentifier)}: ${detail}`, { cause });
|
||||
this.name = 'ExtensionError';
|
||||
this.extension = extensionIdentifier;
|
||||
// Adopt the underlying cause's stack so error telemetry buckets by the real
|
||||
// failure site inside the extension instead of the generic event-dispatch
|
||||
// frames. Extension attribution relies on `this.extension`, not this stack.
|
||||
if (cause?.stack) {
|
||||
this.stack = cause.stack;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user