mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 23:35:54 +01:00
Merge pull request #302835 from microsoft/copilot/narrow-eagle
Enhance ListenerLeakError and ListenerRefusalError to include detailed debugging information
This commit is contained in:
@@ -1071,9 +1071,16 @@ class Stacktrace {
|
||||
|
||||
// error that is logged when going over the configured listener threshold
|
||||
export class ListenerLeakError extends Error {
|
||||
constructor(message: string, stack: string) {
|
||||
super(message);
|
||||
/**
|
||||
* The detailed message including listener count and most frequent stack.
|
||||
* Available locally for debugging but intentionally not used as the error
|
||||
* `message` so that all leak errors group under the same title in telemetry.
|
||||
*/
|
||||
readonly details: string;
|
||||
constructor(details: string, stack: string) {
|
||||
super('potential listener LEAK detected');
|
||||
this.name = 'ListenerLeakError';
|
||||
this.details = details;
|
||||
this.stack = stack;
|
||||
}
|
||||
}
|
||||
@@ -1081,9 +1088,16 @@ export class ListenerLeakError extends Error {
|
||||
// SEVERE error that is logged when having gone way over the configured listener
|
||||
// threshold so that the emitter refuses to accept more listeners
|
||||
export class ListenerRefusalError extends Error {
|
||||
constructor(message: string, stack: string) {
|
||||
super(message);
|
||||
/**
|
||||
* The detailed message including listener count and most frequent stack.
|
||||
* Available locally for debugging but intentionally not used as the error
|
||||
* `message` so that all refusal errors group under the same title in telemetry.
|
||||
*/
|
||||
readonly details: string;
|
||||
constructor(details: string, stack: string) {
|
||||
super('potential listener LEAK detected (REFUSED to add)');
|
||||
this.name = 'ListenerRefusalError';
|
||||
this.details = details;
|
||||
this.stack = stack;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user