diff options
author | Maximilian Krambach <[email protected]> | 2018-08-22 12:49:11 +0000 |
---|---|---|
committer | Maximilian Krambach <[email protected]> | 2018-08-22 12:49:11 +0000 |
commit | 94a0ed361ea04c2a0a2e144877b0e17b9fea35a2 (patch) | |
tree | 7040cdbbcecb61795a72d837e7cdff47b512fdf2 /lang/js | |
parent | Merge branch 'javascript-binding' (diff) | |
download | gpgme-94a0ed361ea04c2a0a2e144877b0e17b9fea35a2.tar.gz gpgme-94a0ed361ea04c2a0a2e144877b0e17b9fea35a2.zip |
js: Return error if signature has no fingerprint
--
* src/Signature.js/get fingerprint: A signature with no fingerprint
should not happen, but if it does, we should throw an error here,
as the method is a getter.
Diffstat (limited to 'lang/js')
-rw-r--r-- | lang/js/src/Signature.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lang/js/src/Signature.js b/lang/js/src/Signature.js index a6539048..530590f9 100644 --- a/lang/js/src/Signature.js +++ b/lang/js/src/Signature.js @@ -87,9 +87,12 @@ class GPGME_Signature { constructor (sigObject){ this._rawSigObject = sigObject; } + /** + * @returns {String} the fingerprint of this signature + */ get fingerprint (){ if (!this._rawSigObject.fingerprint){ - return gpgme_error('SIG_WRONG'); + throw gpgme_error('SIG_WRONG'); } else { return this._rawSigObject.fingerprint; } |