Skip to content

Commit

Permalink
replace references to cli-lib/errorHandlers
Browse files Browse the repository at this point in the history
  • Loading branch information
camden11 committed Oct 16, 2023
1 parent f8957cb commit 2cc9160
Show file tree
Hide file tree
Showing 44 changed files with 78 additions and 76 deletions.
2 changes: 1 addition & 1 deletion packages/cli/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const updateNotifier = require('update-notifier');
const chalk = require('chalk');

const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const { logErrorInstance } = require('../lib/errorHandlers/standardErrors');
const { setLogLevel, getCommandName } = require('../lib/commonOpts');
const {
trackHelpUsage,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/accounts/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const SpinniesManager = require('../../lib/SpinniesManager');
const { deleteAccount } = require('@hubspot/cli-lib/lib/config');
const {
isSpecifiedHubSpotAuthError,
} = require('@hubspot/cli-lib/errorHandlers/apiErrors');
} = require('../../lib/errorHandlers/apiErrors');

const i18nKey = 'cli.commands.accounts.subcommands.clean';

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
const fs = require('fs-extra');
const {
logFileSystemErrorInstance,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../lib/errorHandlers/fileSystemErrors');
const { logger } = require('@hubspot/cli-lib/logger');
const { setLogLevel, getAccountId } = require('../lib/commonOpts');
const { logDebugInfo } = require('../lib/debugInfo');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/customObject/create.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
const { getAbsoluteFilePath } = require('@hubspot/cli-lib/path');
const {
isFileValidJSON,
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/commands/customObject/schema/create.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const {
logErrorInstance,
} = require('../../../lib/errorHandlers/standardErrors');
const { getAbsoluteFilePath } = require('@hubspot/cli-lib/path');
const {
isFileValidJSON,
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/commands/customObject/schema/delete.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const {
logErrorInstance,
} = require('../../../lib/errorHandlers/standardErrors');

const { loadAndValidateOptions } = require('../../../lib/validation');
const { trackCommandUsage } = require('../../../lib/usageTracking');
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/commands/customObject/schema/fetch-all.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const {
logErrorInstance,
} = require('../../../lib/errorHandlers/standardErrors');

const { loadAndValidateOptions } = require('../../../lib/validation');
const { trackCommandUsage } = require('../../../lib/usageTracking');
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/commands/customObject/schema/fetch.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const path = require('path');
const { isConfigFlagEnabled } = require('@hubspot/cli-lib');
const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const {
logErrorInstance,
} = require('../../../lib/errorHandlers/standardErrors');
const { ConfigFlags } = require('@hubspot/cli-lib/lib/constants');
const { downloadSchema, getResolvedPath } = require('@hubspot/cli-lib/schema');
const { fetchSchema } = require('@hubspot/cli-lib/api/fileTransport');
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/commands/customObject/schema/list.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const {
logErrorInstance,
} = require('../../../lib/errorHandlers/standardErrors');

const { loadAndValidateOptions } = require('../../../lib/validation');
const { trackCommandUsage } = require('../../../lib/usageTracking');
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/commands/customObject/schema/update.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const {
logErrorInstance,
} = require('../../../lib/errorHandlers/standardErrors');
const { getAbsoluteFilePath } = require('@hubspot/cli-lib/path');
const {
isFileValidJSON,
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/commands/filemanager/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const { uploadFile } = require('@hubspot/cli-lib/api/fileManager');
const { getCwd, convertToUnixPath } = require('@hubspot/cli-lib/path');
const { logger } = require('@hubspot/cli-lib/logger');
const {
logErrorInstance,
ApiErrorContext,
logApiUploadErrorInstance,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../../lib/errorHandlers/apiErrors');
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
const { validateSrcAndDestPaths } = require('@hubspot/cli-lib/modules');
const { shouldIgnoreFile } = require('@hubspot/cli-lib/ignoreRules');

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/functions/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { trackCommandUsage } = require('../../lib/usageTracking');
const {
logApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../../lib/errorHandlers/apiErrors');
const { POLLING_DELAY } = require('@hubspot/cli-lib/lib/constants');
const { logger } = require('@hubspot/cli-lib/logger');
const {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/functions/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { logger } = require('@hubspot/cli-lib/logger');
const {
logApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../../lib/errorHandlers/apiErrors');
const { getFunctionArrays } = require('../../lib/getFunctionArrays');
const {
getTableContents,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/hubdb/clear.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
const { clearHubDbTableRows } = require('@hubspot/cli-lib/hubdb');
const { publishTable } = require('@hubspot/cli-lib/api/hubdb');

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/hubdb/create.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');

const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
const { getCwd } = require('@hubspot/cli-lib/path');
const { createHubDbTable } = require('@hubspot/cli-lib/hubdb');

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/hubdb/delete.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
const { deleteTable } = require('@hubspot/cli-lib/api/hubdb');
const { loadAndValidateOptions } = require('../../lib/validation');
const { trackCommandUsage } = require('../../lib/usageTracking');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/hubdb/fetch.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
const { downloadHubDbTable } = require('@hubspot/cli-lib/hubdb');

const { loadAndValidateOptions } = require('../../lib/validation');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {
const { addConfigOptions } = require('../lib/commonOpts');
const { handleExit } = require('../lib/process');
const { checkAndUpdateGitignore } = require('@hubspot/cli-lib/lib/git');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const { logErrorInstance } = require('../lib/errorHandlers/standardErrors');
const {
DEFAULT_HUBSPOT_CONFIG_YAML_FILE_NAME,
PERSONAL_ACCESS_KEY_AUTH_METHOD,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/lint.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { lint } = require('@hubspot/cli-lib/validate');
const { printHublValidationResult } = require('../lib/hublValidate');
const { logger } = require('@hubspot/cli-lib/logger');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const { logErrorInstance } = require('../lib/errorHandlers/standardErrors');

const {
addConfigOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { logger } = require('@hubspot/cli-lib/logger');
const {
logApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../lib/errorHandlers/apiErrors');
const {
getDirectoryContentsByPath,
} = require('@hubspot/cli-lib/api/fileMapper');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/mv.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { logger } = require('@hubspot/cli-lib/logger');
const {
logApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../lib/errorHandlers/apiErrors');

const {
addConfigOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/project/add.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { logger } = require('@hubspot/cli-lib/logger');
const { getAccountId } = require('@hubspot/cli-lib/lib/config');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
const { fetchReleaseData } = require('@hubspot/cli-lib/github');

const { trackCommandUsage } = require('../../lib/usageTracking');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/project/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { trackCommandUsage } = require('../../lib/usageTracking');
const {
logApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../../lib/errorHandlers/apiErrors');
const { logger } = require('@hubspot/cli-lib/logger');
const { deployProject, fetchProject } = require('@hubspot/cli-lib/api/dfs');
const { loadAndValidateOptions } = require('../../lib/validation');
Expand Down
11 changes: 5 additions & 6 deletions packages/cli/commands/project/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,17 @@ const {
PROJECT_DEPLOY_TEXT,
ERROR_TYPES,
} = require('@hubspot/cli-lib/lib/constants');
const {
logErrorInstance,
logApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');

const { buildSandbox } = require('../../lib/sandbox-create');
const { syncSandbox } = require('../../lib/sandbox-sync');
const { getHubSpotWebsiteOrigin } = require('@hubspot/cli-lib/lib/urls');
const {
logApiErrorInstance,
ApiErrorContext,
isMissingScopeError,
isSpecifiedError,
} = require('@hubspot/cli-lib/errorHandlers/apiErrors');
} = require('../../lib/errorHandlers/apiErrors');
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');

const i18nKey = 'cli.commands.project.subcommands.dev';

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/project/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const { getCwd } = require('@hubspot/cli-lib/path');
const {
logApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../../lib/errorHandlers/apiErrors');
const { logger } = require('@hubspot/cli-lib/logger');
const { extractZipArchive } = require('@hubspot/cli-lib/archive');
const {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/project/listBuilds.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { i18n } = require('../../lib/lang');
const {
logApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../../lib/errorHandlers/apiErrors');
const { logger } = require('@hubspot/cli-lib/logger');
const {
fetchProject,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/project/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const {
// const {
// logApiErrorInstance,
// ApiErrorContext,
// } = require('@hubspot/cli-lib/errorHandlers');
// } = require('../../lib/errorHandlers/apiErrors');
// const {
// getFunctionLogs,
// getLatestFunctionLog,
Expand Down
6 changes: 2 additions & 4 deletions packages/cli/commands/project/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ const {
const { i18n } = require('../../lib/lang');
const { getAccountConfig } = require('@hubspot/cli-lib');
const { ERROR_TYPES } = require('@hubspot/cli-lib/lib/constants');
const {
isSpecifiedError,
} = require('@hubspot/cli-lib/errorHandlers/apiErrors');
const {
logApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
isSpecifiedError,
} = require('../../lib/errorHandlers/apiErrors');
const { EXIT_CODES } = require('../../lib/enums/exitCodes');

const i18nKey = 'cli.commands.project.subcommands.upload';
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/project/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { createWatcher } = require('../../lib/projectsWatch');
const {
logApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../../lib/errorHandlers/apiErrors');
const { logger } = require('@hubspot/cli-lib/logger');
const { ERROR_TYPES } = require('@hubspot/cli-lib/lib/constants');
const {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { logger } = require('@hubspot/cli-lib/logger');
const {
logApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../lib/errorHandlers/apiErrors');

const {
addConfigOptions,
Expand Down
6 changes: 2 additions & 4 deletions packages/cli/commands/sandbox/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ const {
} = require('../../lib/prompts/sandboxesPrompt');
const { promptUser } = require('../../lib/prompts/promptUtils');
const { syncSandbox } = require('../../lib/sandbox-sync');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
const {
isMissingScopeError,
} = require('@hubspot/cli-lib/errorHandlers/apiErrors');
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');
const { isMissingScopeError } = require('../../lib/errorHandlers/apiErrors');
const { getHubSpotWebsiteOrigin } = require('@hubspot/cli-lib/lib/urls');

const i18nKey = 'cli.commands.sandbox.subcommands.create';
Expand Down
13 changes: 7 additions & 6 deletions packages/cli/commands/sandbox/delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ const { logger } = require('@hubspot/cli-lib/logger');
const { trackCommandUsage } = require('../../lib/usageTracking');
const { loadAndValidateOptions } = require('../../lib/validation');
const {
logErrorInstance,
debugErrorAndContext,
} = require('@hubspot/cli-lib/errorHandlers/standardErrors');
const { logErrorInstance } = require('@hubspot/cli-lib/errorHandlers');
} = require('../../lib/errorHandlers/standardErrors');
const {
isSpecifiedError,
isSpecifiedHubSpotAuthError,
} = require('../../lib/errorHandlers/apiErrors');
const { deleteSandbox } = require('@hubspot/cli-lib/sandboxes');
const { i18n } = require('../../lib/lang');
const { getConfig, getEnv, getAccountConfig } = require('@hubspot/cli-lib');
Expand All @@ -26,10 +30,7 @@ const {
const { EXIT_CODES } = require('../../lib/enums/exitCodes');
const { promptUser } = require('../../lib/prompts/promptUtils');
const { getHubSpotWebsiteOrigin } = require('@hubspot/cli-lib/lib/urls');
const {
isSpecifiedError,
isSpecifiedHubSpotAuthError,
} = require('@hubspot/cli-lib/errorHandlers/apiErrors');

const { getAccountName } = require('../../lib/sandboxes');
const { getValidEnv } = require('@hubspot/cli-lib/lib/environment');

Expand Down
8 changes: 2 additions & 6 deletions packages/cli/commands/sandbox/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@ const {
} = require('../../lib/sandboxes');
const { syncSandbox } = require('../../lib/sandbox-sync');
const { getValidEnv } = require('@hubspot/cli-lib/lib/environment');
const {
isSpecifiedError,
} = require('@hubspot/cli-lib/errorHandlers/apiErrors');
const {
logErrorInstance,
} = require('@hubspot/cli-lib/errorHandlers/standardErrors');
const { isSpecifiedError } = require('../../lib/errorHandlers/apiErrors');
const { logErrorInstance } = require('../../lib/errorHandlers/standardErrors');

const i18nKey = 'cli.commands.sandbox.subcommands.sync';

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/secrets/addSecret.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { logger } = require('@hubspot/cli-lib/logger');
const {
logServerlessFunctionApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../../lib/errorHandlers/apiErrors');
const { addSecret } = require('@hubspot/cli-lib/api/secrets');

const { loadAndValidateOptions } = require('../../lib/validation');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/secrets/deleteSecret.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { logger } = require('@hubspot/cli-lib/logger');
const {
logServerlessFunctionApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../../lib/errorHandlers/apiErrors');
const { deleteSecret } = require('@hubspot/cli-lib/api/secrets');

const { loadAndValidateOptions } = require('../../lib/validation');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/secrets/listSecrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { logger } = require('@hubspot/cli-lib/logger');
const {
logServerlessFunctionApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../../lib/errorHandlers/apiErrors');
const { fetchSecrets } = require('@hubspot/cli-lib/api/secrets');

const { loadAndValidateOptions } = require('../../lib/validation');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/secrets/updateSecret.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { logger } = require('@hubspot/cli-lib/logger');
const {
logServerlessFunctionApiErrorInstance,
ApiErrorContext,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../../lib/errorHandlers/apiErrors');
const { updateSecret } = require('@hubspot/cli-lib/api/secrets');

const { loadAndValidateOptions } = require('../../lib/validation');
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/commands/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const {
} = require('@hubspot/cli-lib/path');
const { logger } = require('@hubspot/cli-lib/logger');
const {
logErrorInstance,
ApiErrorContext,
logApiUploadErrorInstance,
} = require('@hubspot/cli-lib/errorHandlers');
} = require('../lib/errorHandlers/apiErrors');
const { logErrorInstance } = require('../lib/errorHandlers/standardErrors');
const { validateSrcAndDestPaths } = require('@hubspot/cli-lib/modules');
const { shouldIgnoreFile } = require('@hubspot/cli-lib/ignoreRules');

Expand Down
Loading

0 comments on commit 2cc9160

Please sign in to comment.