diff options
Diffstat (limited to 'lang/js/src/Errors.js')
-rw-r--r-- | lang/js/src/Errors.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lang/js/src/Errors.js b/lang/js/src/Errors.js index cb5c94c2..0cf1af19 100644 --- a/lang/js/src/Errors.js +++ b/lang/js/src/Errors.js @@ -143,7 +143,7 @@ export function gpgme_error(code = 'GENERIC_ERROR', info){ * @extends Error */ class GPGME_Error extends Error{ - constructor(code, msg=''){ + constructor(code = 'GENERIC_ERROR', msg=''){ if (code === 'GNUPG_ERROR' && typeof(msg) === 'string'){ super(msg); } else if (err_list.hasOwnProperty(code)){ @@ -155,12 +155,12 @@ class GPGME_Error extends Error{ } else { super(err_list['GENERIC_ERROR'].msg); } - this.code = code || 'GENERIC_ERROR'; - } - set code(value){ - this._code = value; + this.getCode = function(){ + return code; + }; } + get code(){ - return this._code; + return this.getCode(); } }
\ No newline at end of file |