Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Ensure we reject promises on failure (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Young authored May 3, 2017
1 parent d5a4a98 commit 03a9660
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/credentialstore/credentialstore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,15 @@ export class CredentialStore implements ICredentialStore {
this.RemoveCredential(service).then(() => {
this._credentialStore.SetCredential(service, username, password).then(() => {
deferred.resolve(undefined);
}).catch((reason) => {
deferred.reject(reason);
});
});
} else {
this._credentialStore.SetCredential(service, username, password).then(() => {
deferred.resolve(undefined);
}).catch((reason) => {
deferred.reject(reason);
});
}
}).catch((reason) => {
Expand Down

0 comments on commit 03a9660

Please sign in to comment.