catch log and rethrow
This commit is contained in:
parent
c8883b55d1
commit
b5c9cc2151
1 changed files with 4 additions and 2 deletions
|
|
@ -210,9 +210,9 @@ const tryAndWait = async (promGen, shouldRetry = () => false) => {
|
||||||
* @param {string} pub
|
* @param {string} pub
|
||||||
* @returns {Promise<string>}
|
* @returns {Promise<string>}
|
||||||
*/
|
*/
|
||||||
const pubToEpub = pub => {
|
const pubToEpub = async pub => {
|
||||||
try {
|
try {
|
||||||
return timeout10(
|
const epub = await timeout10(
|
||||||
CommonUtils.makePromise(res => {
|
CommonUtils.makePromise(res => {
|
||||||
require('../../Mediator/index')
|
require('../../Mediator/index')
|
||||||
.getGun()
|
.getGun()
|
||||||
|
|
@ -225,6 +225,8 @@ const pubToEpub = pub => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
return epub
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error(err)
|
logger.error(err)
|
||||||
throw new Error(`pubToEpub() -> ${err.message}`)
|
throw new Error(`pubToEpub() -> ${err.message}`)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue