Navigation Menu

Skip to content

Commit

Permalink
refactor: move ExternalHostError
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Jun 23, 2020
1 parent daf2a48 commit 031ad87
Show file tree
Hide file tree
Showing 37 changed files with 37 additions and 36 deletions.
2 changes: 1 addition & 1 deletion lib/config/presets/github/index.ts
@@ -1,6 +1,6 @@
import { PLATFORM_TYPE_GITHUB } from '../../../constants/platforms';
import { logger } from '../../../logger';
import { ExternalHostError } from '../../../types/error';
import { ExternalHostError } from '../../../types/errors/external-host-error';
import { Http, HttpOptions } from '../../../util/http';
import { Preset, PresetConfig } from '../common';
import { PRESET_DEP_NOT_FOUND, fetchPreset } from '../util';
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/gitlab/index.ts
@@ -1,5 +1,5 @@
import { logger } from '../../../logger';
import { ExternalHostError } from '../../../types/error';
import { ExternalHostError } from '../../../types/errors/external-host-error';
import type { GitLabBranch } from '../../../types/platform/gitlab';
import { GitlabHttp } from '../../../util/http/gitlab';
import { Preset, PresetConfig } from '../common';
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/index.ts
@@ -1,7 +1,7 @@
import is from '@sindresorhus/is';
import { CONFIG_VALIDATION } from '../../constants/error-messages';
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { regEx } from '../../util/regex';
import { RenovateConfig } from '../common';
import * as massage from '../massage';
Expand Down
1 change: 1 addition & 0 deletions lib/constants/error-messages.ts
Expand Up @@ -35,6 +35,7 @@ export const MANAGER_NO_PACKAGE_FILES = 'no-package-files';

// Host error
export const EXTERNAL_HOST_ERROR = 'external-host-error';
export const IGNORABLE_HOST_ERROR = 'ignorable-host-error';

// Worker Error
export const WORKER_FILE_UPDATE_FAILED = 'update-failure';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/cdnjs/index.ts
@@ -1,5 +1,5 @@
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { Http } from '../../util/http';
import { CachePromise, cacheAble } from '../cache';
import { GetReleasesConfig, ReleaseResult } from '../common';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/crate/index.ts
@@ -1,5 +1,5 @@
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import * as globalCache from '../../util/cache/global';
import { Http } from '../../util/http';
import { GetReleasesConfig, Release, ReleaseResult } from '../common';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/dart/index.ts
@@ -1,5 +1,5 @@
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { Http, HttpResponse } from '../../util/http';
import { GetReleasesConfig, ReleaseResult } from '../common';

Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/docker/index.ts
Expand Up @@ -6,7 +6,7 @@ import parseLinkHeader from 'parse-link-header';
import wwwAuthenticate from 'www-authenticate';
import { logger } from '../../logger';
import { HostRule } from '../../types';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import * as globalCache from '../../util/cache/global';
import * as hostRules from '../../util/host-rules';
import { Http, HttpResponse } from '../../util/http';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/galaxy/index.ts
@@ -1,5 +1,5 @@
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import * as globalCache from '../../util/cache/global';
import { Http } from '../../util/http';
import { GetReleasesConfig, Release, ReleaseResult } from '../common';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/gradle-version/index.ts
@@ -1,5 +1,5 @@
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { Http } from '../../util/http';
import { regEx } from '../../util/regex';
import { GetReleasesConfig, ReleaseResult } from '../common';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/helm/index.ts
@@ -1,7 +1,7 @@
import yaml from 'js-yaml';

import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import * as globalCache from '../../util/cache/global';
import { Http } from '../../util/http';
import { ensureTrailingSlash } from '../../util/url';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/hex/index.ts
@@ -1,5 +1,5 @@
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { Http } from '../../util/http';
import { GetReleasesConfig, ReleaseResult } from '../common';

Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/index.spec.ts
@@ -1,6 +1,6 @@
import { mocked } from '../../test/util';
import { EXTERNAL_HOST_ERROR } from '../constants/error-messages';
import { ExternalHostError } from '../types/error';
import { ExternalHostError } from '../types/errors/external-host-error';
import { loadModules } from '../util/modules';
import * as datasourceDocker from './docker';
import * as datasourceGithubTags from './github-tags';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/index.ts
@@ -1,7 +1,7 @@
import is from '@sindresorhus/is';
import _ from 'lodash';
import { logger } from '../logger';
import { ExternalHostError } from '../types/error';
import { ExternalHostError } from '../types/errors/external-host-error';
import * as runCache from '../util/cache/run';
import { clone } from '../util/clone';
import * as allVersioning from '../versioning';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/maven/util.ts
@@ -1,6 +1,6 @@
import url from 'url';
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { Http } from '../../util/http';

import { MAVEN_REPO, id } from './common';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/npm/get.spec.ts
@@ -1,6 +1,6 @@
import * as httpMock from '../../../test/httpMock';
import { getName } from '../../../test/util';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { getDependency, resetMemCache } from './get';
import { setNpmrc } from './npmrc';

Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/npm/get.ts
Expand Up @@ -6,7 +6,7 @@ import moment from 'moment';
import registryAuthToken from 'registry-auth-token';
import getRegistryUrl from 'registry-auth-token/registry-url';
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import * as globalCache from '../../util/cache/global';
import { find } from '../../util/host-rules';
import { Http, HttpOptions } from '../../util/http';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/packagist/index.ts
Expand Up @@ -2,7 +2,7 @@ import URL from 'url';

import pAll from 'p-all';
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import * as globalCache from '../../util/cache/global';
import * as runCache from '../../util/cache/run';
import * as hostRules from '../../util/host-rules';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/pod/index.ts
@@ -1,6 +1,6 @@
import crypto from 'crypto';
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import * as globalCache from '../../util/cache/global';
import { Http } from '../../util/http';
import { GithubHttp } from '../../util/http/github';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/repology/index.ts
@@ -1,6 +1,6 @@
import { URLSearchParams } from 'url';
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import * as globalCache from '../../util/cache/global';
import { Http } from '../../util/http';
import { GetReleasesConfig, ReleaseResult } from '../common';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/ruby-version/index.ts
@@ -1,6 +1,6 @@
import { parse } from 'node-html-parser';

import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import * as globalCache from '../../util/cache/global';
import { Http } from '../../util/http';
import { isVersion } from '../../versioning/ruby';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/rubygems/get-rubygems-org.ts
@@ -1,5 +1,5 @@
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { Http } from '../../util/http';
import { ReleaseResult } from '../common';
import { id } from './common';
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/terraform-module/index.ts
@@ -1,5 +1,5 @@
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import * as globalCache from '../../util/cache/global';
import { Http } from '../../util/http';
import { GetReleasesConfig, ReleaseResult } from '../common';
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/gradle/index.ts
Expand Up @@ -5,7 +5,7 @@ import upath from 'upath';
import { LANGUAGE_JAVA } from '../../constants/languages';
import * as datasourceMaven from '../../datasource/maven';
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { ExecOptions, exec } from '../../util/exec';
import { BinarySource } from '../../util/exec/common';
import { readLocalFile } from '../../util/fs';
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/npm/post-update/index.ts
Expand Up @@ -6,7 +6,7 @@ import { SYSTEM_INSUFFICIENT_DISK_SPACE } from '../../../constants/error-message
import { id as npmId } from '../../../datasource/npm';
import { logger } from '../../../logger';
import { platform } from '../../../platform';
import { ExternalHostError } from '../../../types/error';
import { ExternalHostError } from '../../../types/errors/external-host-error';
import { getChildProcessEnv } from '../../../util/exec/env';
import { deleteLocalFile } from '../../../util/fs';
import * as hostRules from '../../../util/host-rules';
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/npm/post-update/yarn.ts
Expand Up @@ -6,7 +6,7 @@ import { join } from 'upath';
import { SYSTEM_INSUFFICIENT_DISK_SPACE } from '../../../constants/error-messages';
import { id as npmId } from '../../../datasource/npm';
import { logger } from '../../../logger';
import { ExternalHostError } from '../../../types/error';
import { ExternalHostError } from '../../../types/errors/external-host-error';
import { ExecOptions, exec } from '../../../util/exec';
import { PostUpdateConfig, Upgrade } from '../../common';
import { getNodeConstraint } from './node-version';
Expand Down
2 changes: 1 addition & 1 deletion lib/platform/git/storage.ts
Expand Up @@ -10,7 +10,7 @@ import {
SYSTEM_INSUFFICIENT_DISK_SPACE,
} from '../../constants/error-messages';
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import * as limits from '../../workers/global/limits';
import { CommitFilesConfig } from '../common';
import { writePrivateKey } from './private-key';
Expand Down
2 changes: 1 addition & 1 deletion lib/platform/github/index.ts
Expand Up @@ -23,7 +23,7 @@ import {
} from '../../constants/pull-requests';
import { logger } from '../../logger';
import { BranchStatus } from '../../types';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import * as hostRules from '../../util/host-rules';
import * as githubHttp from '../../util/http/github';
import { sanitize } from '../../util/sanitize';
Expand Down
@@ -1,4 +1,4 @@
import { EXTERNAL_HOST_ERROR } from '../constants/error-messages';
import { EXTERNAL_HOST_ERROR } from '../../constants/error-messages';

export class ExternalHostError extends Error {
hostType: string;
Expand Down
2 changes: 1 addition & 1 deletion lib/util/http/github.ts
Expand Up @@ -10,7 +10,7 @@ import {
} from '../../constants/error-messages';
import { PLATFORM_TYPE_GITHUB } from '../../constants/platforms';
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { maskToken } from '../mask';
import { Http, HttpPostOptions, HttpResponse, InternalHttpOptions } from '.';

Expand Down
2 changes: 1 addition & 1 deletion lib/util/http/gitlab.ts
Expand Up @@ -2,7 +2,7 @@ import { URL } from 'url';
import parseLinkHeader from 'parse-link-header';
import { PLATFORM_TYPE_GITLAB } from '../../constants/platforms';
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { Http, HttpResponse, InternalHttpOptions } from '.';

let baseUrl = 'https://gitlab.com/api/v4/';
Expand Down
2 changes: 1 addition & 1 deletion lib/util/http/index.ts
@@ -1,7 +1,7 @@
import crypto from 'crypto';
import URL from 'url';
import got from 'got';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import * as runCache from '../cache/run';
import { clone } from '../clone';
import { applyAuthorization } from './auth';
Expand Down
2 changes: 1 addition & 1 deletion lib/workers/branch/index.ts
Expand Up @@ -22,7 +22,7 @@ import { logger } from '../../logger';
import { getAdditionalFiles } from '../../manager/npm/post-update';
import { platform } from '../../platform';
import { BranchStatus } from '../../types';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { emojify } from '../../util/emoji';
import { exec } from '../../util/exec';
import { readLocalFile, writeLocalFile } from '../../util/fs';
Expand Down
2 changes: 1 addition & 1 deletion lib/workers/pr/index.ts
Expand Up @@ -9,7 +9,7 @@ import {
import { logger } from '../../logger';
import { PlatformPrOptions, Pr, platform } from '../../platform';
import { BranchStatus } from '../../types';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { BranchConfig, PrResult } from '../common';
import { getPrBody } from './body';
import { ChangeLogError } from './changelog';
Expand Down
2 changes: 1 addition & 1 deletion lib/workers/repository/error.spec.ts
Expand Up @@ -26,7 +26,7 @@ import {
SYSTEM_INSUFFICIENT_MEMORY,
UNKNOWN_ERROR,
} from '../../constants/error-messages';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import handleError from './error';

jest.mock('./error-config');
Expand Down
2 changes: 1 addition & 1 deletion lib/workers/repository/error.ts
Expand Up @@ -28,7 +28,7 @@ import {
UNKNOWN_ERROR,
} from '../../constants/error-messages';
import { logger } from '../../logger';
import { ExternalHostError } from '../../types/error';
import { ExternalHostError } from '../../types/errors/external-host-error';
import { raiseConfigWarningIssue } from './error-config';

export default async function handleError(
Expand Down
2 changes: 1 addition & 1 deletion lib/workers/repository/init/config.ts
Expand Up @@ -11,7 +11,7 @@ import { CONFIG_VALIDATION } from '../../../constants/error-messages';
import * as npmApi from '../../../datasource/npm';
import { logger } from '../../../logger';
import { platform } from '../../../platform';
import { ExternalHostError } from '../../../types/error';
import { ExternalHostError } from '../../../types/errors/external-host-error';
import { readLocalFile } from '../../../util/fs';
import * as hostRules from '../../../util/host-rules';
import { flattenPackageRules } from './flatten';
Expand Down

0 comments on commit 031ad87

Please sign in to comment.