Move errors.ts to /common
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { NotificationLogger } from "./notification-logger";
|
||||
import { AppTelemetry } from "../telemetry";
|
||||
import { RedactableError } from "../../pure/errors";
|
||||
import { RedactableError } from "../errors";
|
||||
|
||||
export interface ShowAndLogOptions {
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RedactableError } from "../pure/errors";
|
||||
import { RedactableError } from "./errors";
|
||||
|
||||
export interface AppTelemetry {
|
||||
sendCommandUsage(name: string, executionTime: number, error?: Error): void;
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
getErrorMessage,
|
||||
getErrorStack,
|
||||
} from "../../pure/helpers-pure";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
import { redactableError } from "../errors";
|
||||
import { UserCancellationException } from "./progress";
|
||||
import { telemetryListener } from "./telemetry";
|
||||
import { AppTelemetry } from "../telemetry";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Uri, window } from "vscode";
|
||||
import { AppCommandManager } from "../commands";
|
||||
import { showBinaryChoiceDialog } from "./dialog";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
import { redactableError } from "../errors";
|
||||
import {
|
||||
asError,
|
||||
getErrorMessage,
|
||||
|
||||
@@ -18,7 +18,7 @@ import * as appInsights from "applicationinsights";
|
||||
import { extLogger } from "../index";
|
||||
import { UserCancellationException } from "./progress";
|
||||
import { showBinaryChoiceWithUrlDialog } from "./dialog";
|
||||
import { RedactableError } from "../../pure/errors";
|
||||
import { RedactableError } from "../errors";
|
||||
import { SemVer } from "semver";
|
||||
import { AppTelemetry } from "../telemetry";
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
WebviewPanelConfig,
|
||||
} from "../common/vscode/abstract-webview";
|
||||
import { telemetryListener } from "../common/vscode/telemetry";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
|
||||
interface ComparePair {
|
||||
from: CompletedLocalQueryInfo;
|
||||
|
||||
@@ -32,7 +32,7 @@ import { App } from "../common/app";
|
||||
import { ResolvableLocationValue } from "../common/bqrs-cli-types";
|
||||
import { showResolvableLocation } from "../databases/local-databases/locations";
|
||||
import { decodeBqrsToExternalApiUsages } from "./bqrs";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { readQueryResults, runQuery } from "./external-api-usage-query";
|
||||
import { createDataExtensionYaml, loadDataExtensionYaml } from "./yaml";
|
||||
import { ExternalApiUsage } from "./external-api-usage";
|
||||
|
||||
@@ -13,7 +13,7 @@ import { ProgressCallback } from "../common/vscode/progress";
|
||||
import { fetchExternalApiQueries } from "./queries";
|
||||
import { QueryResultType } from "../pure/new-messages";
|
||||
import { join } from "path";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { telemetryListener } from "../common/vscode/telemetry";
|
||||
|
||||
export type RunQueryOptions = {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
ModeledMethodType,
|
||||
ModeledMethodWithSignature,
|
||||
} from "./modeled-method";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { QueryResultType } from "../pure/new-messages";
|
||||
import { file } from "tmp-promise";
|
||||
import { writeFile } from "fs-extra";
|
||||
|
||||
@@ -45,7 +45,7 @@ import { asError, asyncFilter, getErrorMessage } from "../pure/helpers-pure";
|
||||
import { QueryRunner } from "../query-server";
|
||||
import { isCanary } from "../config";
|
||||
import { App } from "../common/app";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { LocalDatabasesCommands } from "../common/commands";
|
||||
import {
|
||||
createMultiSelectionCommand,
|
||||
|
||||
@@ -24,7 +24,7 @@ import { existsSync } from "fs";
|
||||
import { QlPackGenerator } from "../../qlpack-generator";
|
||||
import { asError, getErrorMessage } from "../../pure/helpers-pure";
|
||||
import { DatabaseItem, PersistedDatabaseItem } from "./database-item";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import { remove } from "fs-extra";
|
||||
import { containsPath } from "../../pure/files";
|
||||
import { DatabaseChangedEvent, DatabaseEventKind } from "./database-events";
|
||||
|
||||
@@ -115,7 +115,7 @@ import { VSCodeMockGitHubApiServer } from "./variant-analysis/gh-api/mocks/vscod
|
||||
import { VariantAnalysisResultsManager } from "./variant-analysis/variant-analysis-results-manager";
|
||||
import { ExtensionApp } from "./common/vscode/vscode-app";
|
||||
import { DbModule } from "./databases/db-module";
|
||||
import { redactableError } from "./pure/errors";
|
||||
import { redactableError } from "./common/errors";
|
||||
import { QLDebugAdapterDescriptorFactory } from "./debugger/debugger-factory";
|
||||
import { QueryHistoryDirs } from "./query-history/query-history-dirs";
|
||||
import {
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
} from "../../common/bqrs-utils";
|
||||
import { DisposableObject } from "../../common/disposable-object";
|
||||
import { asError, getErrorMessage } from "../../pure/helpers-pure";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import { AstViewerCommands } from "../../common/commands";
|
||||
import { extLogger } from "../../common";
|
||||
import { showAndLogExceptionWithTelemetry } from "../../common/logging";
|
||||
|
||||
@@ -22,7 +22,7 @@ import { showAndLogExceptionWithTelemetry } from "../../common/logging";
|
||||
import { CancellationToken } from "vscode";
|
||||
import { ProgressCallback } from "../../common/vscode/progress";
|
||||
import { CoreCompletedQuery, QueryRunner } from "../../query-server";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import { QLPACK_FILENAMES } from "../../pure/ql";
|
||||
import { telemetryListener } from "../../common/vscode/telemetry";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import { QueryRunner } from "../query-server";
|
||||
import { basename, join } from "path";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { AppCommandManager, QueryEditorCommands } from "../common/commands";
|
||||
import { extLogger } from "../common";
|
||||
import { showAndLogExceptionWithTelemetry } from "../common/logging";
|
||||
|
||||
@@ -18,7 +18,7 @@ import { CompletedLocalQueryInfo, LocalQueryInfo } from "../query-results";
|
||||
import { WebviewReveal } from "./webview";
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import { QueryResultType } from "../pure/new-messages";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { LocalQueries } from "./local-queries";
|
||||
import { tryGetQueryMetadata } from "../codeql-cli/query-metadata";
|
||||
import { telemetryListener } from "../common/vscode/telemetry";
|
||||
|
||||
@@ -72,7 +72,7 @@ import {
|
||||
import { isCanary, PAGE_SIZE } from "../config";
|
||||
import { HistoryItemLabelProvider } from "../query-history/history-item-label-provider";
|
||||
import { telemetryListener } from "../common/vscode/telemetry";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { ResultsViewCommands } from "../common/commands";
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
showAndLogInformationMessage,
|
||||
} from "../common/logging";
|
||||
import { asError, getErrorStack } from "../pure/helpers-pure";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { PACKS_BY_QUERY_LANGUAGE } from "../common/query-language";
|
||||
import { PackagingCommands } from "../common/commands";
|
||||
import { telemetryListener } from "../common/vscode/telemetry";
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Helper functions that don't depend on vscode or the CLI and therefore can be used by the front-end and pure unit tests.
|
||||
*/
|
||||
|
||||
import { RedactableError } from "./errors";
|
||||
import { RedactableError } from "../common/errors";
|
||||
|
||||
/**
|
||||
* This error is used to indicate a runtime failure of an exhaustivity check enforced at compile time.
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
RepositoriesFilterSortState,
|
||||
RepositoriesFilterSortStateWithIds,
|
||||
} from "./variant-analysis-filter-sort";
|
||||
import { ErrorLike } from "./errors";
|
||||
import { ErrorLike } from "../common/errors";
|
||||
import { DataFlowPaths } from "../variant-analysis/shared/data-flow-paths";
|
||||
import { ExternalApiUsage } from "../data-extensions-editor/external-api-usage";
|
||||
import { ModeledMethod } from "../data-extensions-editor/modeled-method";
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from "vscode";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { asError, getErrorMessage } from "../pure/helpers-pure";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { EvalLogViewerCommands } from "../common/commands";
|
||||
import { extLogger } from "../common";
|
||||
import { showAndLogExceptionWithTelemetry } from "../common/logging";
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
getErrorStack,
|
||||
} from "../../pure/helpers-pure";
|
||||
import { QueryHistoryInfo } from "../query-history-info";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import { QueryHistoryDto, QueryHistoryItemDto } from "./query-history-dto";
|
||||
import { mapQueryHistoryToDomainModel } from "./query-history-dto-mapper";
|
||||
import { mapQueryHistoryToDto } from "./query-history-domain-mapper";
|
||||
|
||||
@@ -23,7 +23,7 @@ import * as qsClient from "./query-server-client";
|
||||
import { asError, getErrorMessage } from "../../pure/helpers-pure";
|
||||
import { compileDatabaseUpgradeSequence } from "./upgrades";
|
||||
import { QueryEvaluationInfo, QueryOutputDir } from "../../run-queries-shared";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import { CoreQueryResults, CoreQueryTarget } from "../query-runner";
|
||||
import { Position } from "../../pure/messages-shared";
|
||||
import { ensureDirSync } from "fs-extra";
|
||||
|
||||
@@ -13,7 +13,7 @@ import * as tmp from "tmp-promise";
|
||||
import { dirname } from "path";
|
||||
import { DatabaseItem } from "../../databases/local-databases";
|
||||
import { asError, getErrorMessage } from "../../pure/helpers-pure";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import { telemetryListener } from "../../common/vscode/telemetry";
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@ import { CodeQLCliServer, TestCompleted } from "../codeql-cli/cli";
|
||||
import { DatabaseItem, DatabaseManager } from "../databases/local-databases";
|
||||
import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders";
|
||||
import { asError, getErrorMessage } from "../pure/helpers-pure";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { access } from "fs-extra";
|
||||
import { BaseLogger, extLogger } from "../common";
|
||||
import {
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
ToDataFlowPathsMessage,
|
||||
} from "../pure/interface-types";
|
||||
import { DataFlowPaths } from "./shared/data-flow-paths";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { extLogger } from "../common";
|
||||
import { showAndLogExceptionWithTelemetry } from "../common/logging";
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ import {
|
||||
import { URLSearchParams } from "url";
|
||||
import { DbManager } from "../databases/db-manager";
|
||||
import { App } from "../common/app";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { AppCommandManager, VariantAnalysisCommands } from "../common/commands";
|
||||
import { exportVariantAnalysisResults } from "./export-results";
|
||||
import {
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
VariantAnalysisViewManager,
|
||||
} from "./variant-analysis-view-manager";
|
||||
import { telemetryListener } from "../common/vscode/telemetry";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { DataFlowPathsView } from "./data-flow-paths-view";
|
||||
import { DataFlowPaths } from "./shared/data-flow-paths";
|
||||
import { App } from "../common/app";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { redactableError, RedactableError } from "../../../src/pure/errors";
|
||||
import { redactableError, RedactableError } from "../../../src/common/errors";
|
||||
|
||||
describe("errorMessage", () => {
|
||||
it("creates a RedactableError", () => {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { load } from "js-yaml";
|
||||
import { dirname, join } from "path";
|
||||
import { fetchExternalApiQueries } from "../../../../src/data-extensions-editor/queries";
|
||||
import * as log from "../../../../src/common/logging/notifications";
|
||||
import { RedactableError } from "../../../../src/pure/errors";
|
||||
import { RedactableError } from "../../../../src/common/errors";
|
||||
import { showAndLogExceptionWithTelemetry } from "../../../../src/common/logging";
|
||||
|
||||
function createMockUri(path = "/a/b/c/foo"): Uri {
|
||||
|
||||
@@ -13,7 +13,7 @@ import { UserCancellationException } from "../../../src/common/vscode/progress";
|
||||
import { ENABLE_TELEMETRY } from "../../../src/config";
|
||||
import { createMockExtensionContext } from "./index";
|
||||
import { vscodeGetConfigurationMock } from "../test-config";
|
||||
import { redactableError } from "../../../src/pure/errors";
|
||||
import { redactableError } from "../../../src/common/errors";
|
||||
import { SemVer } from "semver";
|
||||
|
||||
// setting preferences can trigger lots of background activity
|
||||
|
||||
Reference in New Issue
Block a user