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/Helpers.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/Helpers.js')
-rw-r--r-- | lang/js/src/Helpers.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lang/js/src/Helpers.js b/lang/js/src/Helpers.js index d9750ba7..841c0eda 100644 --- a/lang/js/src/Helpers.js +++ b/lang/js/src/Helpers.js @@ -17,7 +17,7 @@ * License along with this program; if not, see <http://www.gnu.org/licenses/>. * SPDX-License-Identifier: LGPL-2.1+ */ -import { GPGMEJS_Error } from "./Errors"; +import { gpgme_error } from "./Errors"; /** * Tries to return an array of fingerprints, either from input fingerprints or @@ -28,7 +28,7 @@ import { GPGMEJS_Error } from "./Errors"; export function toKeyIdArray(input, nocheck){ if (!input){ - GPGMEJS_Error('MSG_NO_KEYS'); + gpgme_error('MSG_NO_KEYS'); return []; } if (!Array.isArray(input)){ @@ -40,7 +40,7 @@ export function toKeyIdArray(input, nocheck){ if (isFingerprint(input[i]) === true){ result.push(input[i]); } else { - GPGMEJS_Error('MSG_NOT_A_FPR'); + gpgme_error('MSG_NOT_A_FPR'); } } else if (typeof(input[i]) === 'object'){ let fpr = ''; @@ -53,14 +53,14 @@ export function toKeyIdArray(input, nocheck){ if (isFingerprint(fpr) === true){ result.push(fpr); } else { - GPGMEJS_Error('MSG_NOT_A_FPR'); + gpgme_error('MSG_NOT_A_FPR'); } } else { - return GPGMEJS_Error('PARAM_WRONG'); + return gpgme_error('PARAM_WRONG'); } } if (result.length === 0){ - GPGMEJS_Error('MSG_NO_KEYS'); + gpgme_error('MSG_NO_KEYS'); return []; } else { return result; |