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

Credential Store: Ensure we reject promises on failure #207

Merged
merged 1 commit into from
May 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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