From b5c9cc2151f61633db8679682e4b9234230a370d Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Wed, 3 Feb 2021 11:09:55 -0400 Subject: [PATCH] catch log and rethrow --- services/gunDB/contact-api/utils/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/gunDB/contact-api/utils/index.js b/services/gunDB/contact-api/utils/index.js index fc2abcd3..3af89742 100644 --- a/services/gunDB/contact-api/utils/index.js +++ b/services/gunDB/contact-api/utils/index.js @@ -210,9 +210,9 @@ const tryAndWait = async (promGen, shouldRetry = () => false) => { * @param {string} pub * @returns {Promise} */ -const pubToEpub = pub => { +const pubToEpub = async pub => { try { - return timeout10( + const epub = await timeout10( CommonUtils.makePromise(res => { require('../../Mediator/index') .getGun() @@ -225,6 +225,8 @@ const pubToEpub = pub => { }) }) ) + + return epub } catch (err) { logger.error(err) throw new Error(`pubToEpub() -> ${err.message}`)