diff options
author | Maximilian Krambach <[email protected]> | 2018-08-22 10:18:55 +0000 |
---|---|---|
committer | Maximilian Krambach <[email protected]> | 2018-08-22 10:18:55 +0000 |
commit | 93f674d33d4dacb115398196a7218c28323fd708 (patch) | |
tree | 56f3169f96f36dbbc682b06dfcf2c28cf9c0b5ff /lang/js/src/Keyring.js | |
parent | js: update decrypt/verify results (diff) | |
download | gpgme-93f674d33d4dacb115398196a7218c28323fd708.tar.gz gpgme-93f674d33d4dacb115398196a7218c28323fd708.zip |
js: throw errors in sync functions
--
* synchronous functions should throw errors if something goes wrong,
Promises should reject. This commit changes some error cases that
returned Error objects instead of throwing them
- src/Key.js: createKey() and sync Key.get() throw errors
- src/Error.js: Exporting the list of errors to be able to test and
compare against these strings
- src/Keyring.js: Setting a null value in pattern is not useful, and
now caused an error with the new changes.
- src/Message.js: createMessage and Message.setParameter now throw
errors
Diffstat (limited to 'lang/js/src/Keyring.js')
-rw-r--r-- | lang/js/src/Keyring.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lang/js/src/Keyring.js b/lang/js/src/Keyring.js index ab0144ef..cb053ba1 100644 --- a/lang/js/src/Keyring.js +++ b/lang/js/src/Keyring.js @@ -67,7 +67,9 @@ export class GPGME_Keyring { if (prepare_sync === true) { secondrequest = function () { let msg2 = createMessage('keylist'); - msg2.setParameter('keys', pattern); + if (pattern){ + msg2.setParameter('keys', pattern); + } msg2.setParameter('secret', true); return msg2.post(); }; |