fix(presets): pass rate limit up

This commit is contained in:
Rhys Arkins 2020-07-23 14:23:26 +02:00
parent 22a93c968f
commit 5e945db707

View file

@ -1,5 +1,8 @@
import is from '@sindresorhus/is'; import is from '@sindresorhus/is';
import { CONFIG_VALIDATION } from '../../constants/error-messages'; import {
CONFIG_VALIDATION,
PLATFORM_RATE_LIMIT_EXCEEDED,
} from '../../constants/error-messages';
import { logger } from '../../logger'; import { logger } from '../../logger';
import { ExternalHostError } from '../../types/errors/external-host-error'; import { ExternalHostError } from '../../types/errors/external-host-error';
import { regEx } from '../../util/regex'; import { regEx } from '../../util/regex';
@ -207,6 +210,10 @@ export async function resolveConfigPresets(
if (err instanceof ExternalHostError) { if (err instanceof ExternalHostError) {
throw err; throw err;
} }
// istanbul ignore if
if (err.message === PLATFORM_RATE_LIMIT_EXCEEDED) {
throw err;
}
const error = new Error(CONFIG_VALIDATION); const error = new Error(CONFIG_VALIDATION);
if (err.message === 'dep not found') { if (err.message === 'dep not found') {
error.validationError = `Cannot find preset's package (${preset})`; error.validationError = `Cannot find preset's package (${preset})`;