-
Notifications
You must be signed in to change notification settings - Fork 39.7k
Suppress UNC host access errors from unhandled-error telemetry #312236
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
base: main
Are you sure you want to change the base?
Changes from all commits
1809681
4b68aa8
2c61e9a
0ad9bb6
6f3dfaf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ import { AbstractNonRecursiveWatcherClient, AbstractUniversalWatcherClient, ILog | |
| import { AbstractDiskFileSystemProvider } from '../common/diskFileSystemProvider.js'; | ||
| import { UniversalWatcherClient } from './watcher/watcherClient.js'; | ||
| import { NodeJSWatcherClient } from './watcher/nodejs/nodejsClient.js'; | ||
| import { markAsErrorNoTelemetry } from '../../../base/common/errors.js'; | ||
|
|
||
| export class DiskFileSystemProvider extends AbstractDiskFileSystemProvider implements | ||
| IFileSystemProviderWithFileReadWriteCapability, | ||
|
|
@@ -846,6 +847,7 @@ export class DiskFileSystemProvider extends AbstractDiskFileSystemProvider imple | |
|
|
||
| let resultError: Error | string = error; | ||
| let code: FileSystemProviderErrorCode; | ||
| let isExpected = false; | ||
| switch (error.code) { | ||
| case 'ENOENT': | ||
| code = FileSystemProviderErrorCode.FileNotFound; | ||
|
|
@@ -865,13 +867,25 @@ export class DiskFileSystemProvider extends AbstractDiskFileSystemProvider imple | |
| break; | ||
| case 'ERR_UNC_HOST_NOT_ALLOWED': | ||
| resultError = `${error.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`; | ||
|
bryanchen-d marked this conversation as resolved.
|
||
| code = FileSystemProviderErrorCode.Unknown; | ||
| // Treat UNC host restriction as a permission denial: it is a | ||
| // security policy preventing access to the host, not an | ||
| // unknown failure. The error is also marked as expected so it | ||
| // is not reported as an unhandled error in telemetry — the | ||
| // host allowlist is user-configured and access denials are a | ||
| // normal outcome rather than a bug. | ||
| code = FileSystemProviderErrorCode.NoPermissions; | ||
| isExpected = true; | ||
| break; | ||
| default: | ||
| code = FileSystemProviderErrorCode.Unknown; | ||
| } | ||
|
|
||
| return createFileSystemProviderError(resultError, code); | ||
| const providerError = createFileSystemProviderError(resultError, code); | ||
| if (isExpected) { | ||
| markAsErrorNoTelemetry(providerError); | ||
| } | ||
|
Comment on lines
+883
to
+886
|
||
|
|
||
| return providerError; | ||
| } | ||
|
|
||
| private async toFileSystemProviderWriteError(resource: URI | undefined, error: NodeJS.ErrnoException): Promise<FileSystemProviderError> { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.