diff options
author | Maximilian Krambach <[email protected]> | 2018-04-25 13:59:36 +0000 |
---|---|---|
committer | Maximilian Krambach <[email protected]> | 2018-04-25 13:59:36 +0000 |
commit | 1fb310cabe578625f96fce5d84ff6f0092c08d24 (patch) | |
tree | 7d86ba979e8a4c39fd75ea2f727cce8c169d4e08 /lang/js/src/Message.js | |
parent | js: reactivate timeout on connection (diff) | |
download | gpgme-1fb310cabe578625f96fce5d84ff6f0092c08d24.tar.gz gpgme-1fb310cabe578625f96fce5d84ff6f0092c08d24.zip |
js: Configuration and Error handling
--
* gpgmejs_openpgpjs
- unsuported values with no negative consequences can now reject,
warn or be ignored, according to config.unconsidered_params
- cleanup of unsupported/supported parameters and TODOS
* A src/index.js init() now accepts a configuration object
* Errors will now be derived from Error, offering more info and a
stacktrace.
* Fixed Connection.post() timeout triggering on wrong cases
* Added comments in permittedOperations.js, which gpgme interactions
are still unimplemented and should be added next
Diffstat (limited to 'lang/js/src/Message.js')
-rw-r--r-- | lang/js/src/Message.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lang/js/src/Message.js b/lang/js/src/Message.js index 1b36f11d..06ac8db2 100644 --- a/lang/js/src/Message.js +++ b/lang/js/src/Message.js @@ -18,7 +18,7 @@ * SPDX-License-Identifier: LGPL-2.1+ */ import { permittedOperations } from './permittedOperations' -import { GPGMEJS_Error } from './Errors' +import { gpgme_error } from './Errors' export class GPGME_Message { //TODO getter @@ -39,20 +39,20 @@ export class GPGME_Message { */ setParameter(param,value){ if (!param || typeof(param) !== 'string'){ - return GPGMEJS_Error('PARAM_WRONG'); + return gpgme_error('PARAM_WRONG'); } if (!this._msg || !this._msg.op){ - return GPGMEJS_Error('MSG_OP_PENDING'); + return gpgme_error('MSG_OP_PENDING'); } let po = permittedOperations[this._msg.op]; if (!po){ - return GPGMEJS_Error('MSG_WRONG_OP'); + return gpgme_error('MSG_WRONG_OP'); } if (po.required.indexOf(param) >= 0 || po.optional.indexOf(param) >= 0){ this._msg[param] = value; return true; } - return GPGMEJS_Error('PARAM_WRONG'); + return gpgme_error('PARAM_WRONG'); } /** @@ -98,7 +98,7 @@ export class GPGME_Message { */ function setOperation (scope, operation){ if (!operation || typeof(operation) !== 'string'){ - return GPGMEJS_Error('PARAM_WRONG'); + return gpgme_error('PARAM_WRONG'); } if (permittedOperations.hasOwnProperty(operation)){ if (!scope._msg){ @@ -106,6 +106,6 @@ function setOperation (scope, operation){ } scope._msg.op = operation; } else { - return GPGMEJS_Error('MSG_WRONG_OP'); + return gpgme_error('MSG_WRONG_OP'); } }
\ No newline at end of file |