mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-25 15:01:49 +00:00
fix(github): Shrink GraphQL pagination for ExternalHostError (#18435)
This commit is contained in:
@@ -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<
|
||||
|
||||
Reference in New Issue
Block a user