Skip to content

Commit

Permalink
fix(pr): wider try/catch on changelog versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Apr 23, 2020
1 parent e79319d commit 7b6d2d9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/workers/pr/changelog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
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 releases = args.releases || (await getInRangeReleases(args));

try {
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;
}
}

0 comments on commit 7b6d2d9

Please sign in to comment.