From 72ff9eb21a269eac2643810b36c4388a8dc4317a Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Wed, 29 Jan 2020 11:58:25 -0400 Subject: [PATCH] better err msg --- services/gunDB/Mediator/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/services/gunDB/Mediator/index.js b/services/gunDB/Mediator/index.js index c34776ed..4b22e1f8 100644 --- a/services/gunDB/Mediator/index.js +++ b/services/gunDB/Mediator/index.js @@ -23,7 +23,10 @@ const IS_GUN_AUTH = 'IS_GUN_AUTH' mySEA.encrypt = (msg, secret) => { if (typeof msg !== 'string') { - throw new TypeError('mySEA.encrypt() -> expected msg to be an string') + throw new TypeError( + 'mySEA.encrypt() -> expected msg to be an string instead got: ' + + typeof msg + ) } if (msg.length === 0) { @@ -42,7 +45,10 @@ mySEA.encrypt = (msg, secret) => { mySEA.decrypt = (encMsg, secret) => { if (typeof encMsg !== 'string') { - throw new TypeError('mySEA.encrypt() -> expected encMsg to be an string') + throw new TypeError( + 'mySEA.encrypt() -> expected encMsg to be an string instead got: ' + + typeof encMsg + ) } if (encMsg.length === 0) {