Update README.md (#26)

Added a catch block for a get request to show how a potential error could get caught.
This commit is contained in:
Daniel Winter 2016-06-08 23:21:06 +02:00 committed by Joel Arvidsson
parent 050cc84c46
commit 1ef171d799
1 changed files with 3 additions and 1 deletions

View File

@ -46,6 +46,8 @@ Keychain
.getGenericPassword()
.then(function(credentials) {
console.log('Credentials successfully loaded for user ' + credentials.username);
}).catch(function(error) {
console.log('Keychain couldn\'t be accessed! Maybe no value set?', error);
});
// service argument optional
@ -140,4 +142,4 @@ Keychain
- [ ] Expose wider selection of underlying native APIs
## License
MIT © Joel Arvidsson 2015
MIT © Joel Arvidsson 2016