From cfecdd54612140a54d29d591a9c27ae92316417d Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Tue, 7 Jun 2022 15:53:21 -0400 Subject: [PATCH] Adopt error no telemetry for filesystem providers. (#148832) Adopt erorr no telemetry --- src/vs/platform/files/common/fileService.ts | 3 ++- src/vs/workbench/api/common/extHostFileSystem.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/platform/files/common/fileService.ts b/src/vs/platform/files/common/fileService.ts index c05a9374965..2117a5228f0 100644 --- a/src/vs/platform/files/common/fileService.ts +++ b/src/vs/platform/files/common/fileService.ts @@ -7,6 +7,7 @@ import { coalesce } from 'vs/base/common/arrays'; import { Promises, ResourceQueue } from 'vs/base/common/async'; import { bufferedStreamToBuffer, bufferToReadable, newWriteableBufferStream, readableToBuffer, streamToBuffer, VSBuffer, VSBufferReadable, VSBufferReadableBufferedStream, VSBufferReadableStream } from 'vs/base/common/buffer'; import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; +import { ErrorNoTelemetry } from 'vs/base/common/errors'; import { Emitter } from 'vs/base/common/event'; import { hash } from 'vs/base/common/hash'; import { Iterable } from 'vs/base/common/iterator'; @@ -136,7 +137,7 @@ export class FileService extends Disposable implements IFileService { // Assert provider const provider = this.provider.get(resource.scheme); if (!provider) { - const error = new Error(); + const error = new ErrorNoTelemetry(); error.name = 'ENOPRO'; error.message = localize('noProviderFound', "No file system provider found for resource '{0}'", resource.toString()); diff --git a/src/vs/workbench/api/common/extHostFileSystem.ts b/src/vs/workbench/api/common/extHostFileSystem.ts index 208bc41aabd..42ae83b1a41 100644 --- a/src/vs/workbench/api/common/extHostFileSystem.ts +++ b/src/vs/workbench/api/common/extHostFileSystem.ts @@ -17,6 +17,7 @@ import { CharCode } from 'vs/base/common/charCode'; import { VSBuffer } from 'vs/base/common/buffer'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; +import { ErrorNoTelemetry } from 'vs/base/common/errors'; class FsLinkProvider { @@ -295,7 +296,7 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape { private _getFsProvider(handle: number): vscode.FileSystemProvider { const provider = this._fsProvider.get(handle); if (!provider) { - const err = new Error(); + const err = new ErrorNoTelemetry(); err.name = 'ENOPRO'; err.message = `no provider`; throw err;