Skip to content

Commit

Permalink
Log error on failure (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wu authored Jul 11, 2017
1 parent 155fbcf commit 4f45be2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/commands/lock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ function run(unlockOptions: ILockOptions) {
token,
} = unlockOptions;
const branchManager = new BranchManager(githubApi, token, logLevel, caFileContents);
branchManager.lockMatchingBranches(repository, branch, branchProtectionOptions, dryRun);
branchManager.lockMatchingBranches(repository, branch, branchProtectionOptions, dryRun)
.then(({ error }) => {
if (error !== undefined) {
throw error;
}
});
}

main();
7 changes: 6 additions & 1 deletion src/commands/unlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ function main() {
function run(unlockOptions: IUnlockOptions) {
const { branch, caFileContents, dryRun, githubApi, logLevel, repository, token } = unlockOptions;
const branchManager = new BranchManager(githubApi, token, logLevel, caFileContents);
branchManager.unlockMatchingBranches(repository, branch, dryRun);
branchManager.unlockMatchingBranches(repository, branch, dryRun)
.then(({ error }) => {
if (error !== undefined) {
throw error;
}
});
}

main();

0 comments on commit 4f45be2

Please sign in to comment.