diff --git a/lib/util/github/graphql/datasource-helper.ts b/lib/util/github/graphql/datasource-helper.ts index a8d275efc2fe083b80d94d932bc04ff6fb7184b6..0f94b1aa33ba103c9c48c933f58aa74a50816ff2 100644 --- a/lib/util/github/graphql/datasource-helper.ts +++ b/lib/util/github/graphql/datasource-helper.ts @@ -1,6 +1,6 @@ import AggregateError from 'aggregate-error'; -import { TimeoutError } from 'got'; import { logger } from '../../../logger'; +import { ExternalHostError } from '../../../types/errors/external-host-error'; import * as memCache from '../../cache/memory'; import type { GithubGraphqlResponse, @@ -30,13 +30,11 @@ function isUnknownGraphqlError(err: Error): boolean { return message.startsWith('Something went wrong while executing your query.'); } -function isTimeoutError(err: Error): err is TimeoutError { - return err instanceof TimeoutError; -} - function canBeSolvedByShrinking(err: Error): boolean { const errors: Error[] = err instanceof AggregateError ? [...err] : [err]; - return errors.some((e) => isTimeoutError(e) || isUnknownGraphqlError(e)); + return errors.some( + (e) => err instanceof ExternalHostError || isUnknownGraphqlError(e) + ); } export class GithubGraphqlDatasourceHelper<