From c72adc00965fe4fcedd9d18609211021a091b28b Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Wed, 25 Apr 2018 10:54:24 +0200 Subject: js: change in Error behaviour -- * Error objects will now return the error code if defined as error type in src/Errors.js, or do a console.log if it is a warning. Errors from the native gpgme-json will be marked as GNUPG_ERROR. --- lang/js/src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lang/js/src/index.js') diff --git a/lang/js/src/index.js b/lang/js/src/index.js index 0cb2301c..a54277c2 100644 --- a/lang/js/src/index.js +++ b/lang/js/src/index.js @@ -19,6 +19,7 @@ */ import { GpgME } from "./gpgmejs"; +import { GPGMEJS_Error } from "./Errors"; import { GpgME_openpgpmode } from "./gpgmejs_openpgpjs"; import { Connection } from "./Connection"; @@ -45,7 +46,7 @@ function init( config = { resolve(new GpgME(connection)); } } else { - reject('NO_CONNECT'); + reject(GPGMEJS_Error('CONN_NO_CONNECT')); } }; setTimeout(delayedreaction, 5); -- cgit v1.2.3