Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have FileSystemError adopt ErrorNoTelemetry #155885

Merged
merged 4 commits into from Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/vs/base/common/errors.ts
Expand Up @@ -243,7 +243,7 @@ export class ErrorNoTelemetry extends Error {

constructor(msg?: string) {
super(msg);
this.name = 'ErrorNoTelemetry';
this.name = 'CodeExpectedError';
}

public static fromError(err: Error): ErrorNoTelemetry {
Expand All @@ -258,7 +258,7 @@ export class ErrorNoTelemetry extends Error {
}

public static isErrorNoTelemetry(err: Error): err is ErrorNoTelemetry {
bpasero marked this conversation as resolved.
Show resolved Hide resolved
return err.name === 'ErrorNoTelemetry';
return err.name === 'CodeExpectedError';
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/vs/platform/telemetry/common/errorTelemetry.ts
Expand Up @@ -7,6 +7,7 @@ import { binarySearch } from 'vs/base/common/arrays';
import { errorHandler, ErrorNoTelemetry } from 'vs/base/common/errors';
import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
import { safeStringify } from 'vs/base/common/objects';
import { FileOperationError } from 'vs/platform/files/common/files';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';

type ErrorEventFragment = {
Expand Down Expand Up @@ -87,7 +88,8 @@ export default abstract class BaseErrorTelemetry {
}

// If it's the no telemetry error it doesn't get logged
if (ErrorNoTelemetry.isErrorNoTelemetry(err)) {
// TOOD @lramos15 hacking in FileOperation error because it's too messy to adopt ErrorNoTelemetry. A better solution should be found
if (ErrorNoTelemetry.isErrorNoTelemetry(err) || err instanceof FileOperationError) {
lramos15 marked this conversation as resolved.
Show resolved Hide resolved
return;
}

Expand Down