refactor: log files if commit files to branch fails

This commit is contained in:
Rhys Arkins 2018-02-21 06:52:56 +01:00
parent 27d0626b62
commit d258c3849e

View file

@ -1014,11 +1014,16 @@ async function commitFilesToBranch(
gitPrivateKey gitPrivateKey
); );
const isBranchExisting = await branchExists(branchName); const isBranchExisting = await branchExists(branchName);
try {
if (isBranchExisting) { if (isBranchExisting) {
await updateBranch(branchName, commit); await updateBranch(branchName, commit);
} else { } else {
await createBranch(branchName, commit); await createBranch(branchName, commit);
} }
} catch (err) /* istanbul ignore next */ {
logger.debug({ files });
throw err;
}
} }
// Internal branch operations // Internal branch operations