fix(pr): wider try/catch on changelog versioning

This commit is contained in:
Rhys Arkins 2020-04-23 18:35:46 +02:00
parent e79319d300
commit 7b6d2d9c99

View file

@ -11,21 +11,21 @@ export async function getChangeLogJSON(
args: BranchUpgradeConfig
): Promise<ChangeLogResult | null> {
const { sourceUrl, versioning, fromVersion, toVersion } = args;
if (!sourceUrl) {
return null;
}
const version = allVersioning.get(versioning);
if (!fromVersion || version.equals(fromVersion, toVersion)) {
return null;
}
const releases = args.releases || (await getInRangeReleases(args));
try {
if (!sourceUrl) {
return null;
}
const version = allVersioning.get(versioning);
if (!fromVersion || version.equals(fromVersion, toVersion)) {
return null;
}
const releases = args.releases || (await getInRangeReleases(args));
const res = await sourceGithub.getChangeLogJSON({ ...args, releases });
return res;
} catch (err) /* istanbul ignore next */ {
logger.error({ err }, 'getChangeLogJSON error');
logger.error({ args, err }, 'getChangeLogJSON error');
return null;
}
}