Fix: fix promise in findOperatorId
This commit is contained in:
parent
afb5ceea71
commit
fc39d9b1a3
1 changed files with 6 additions and 3 deletions
|
|
@ -19,12 +19,15 @@ function getMnemonic () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function findOperatorId (req, res, next) {
|
function findOperatorId (req, res, next) {
|
||||||
getMnemonic().then(mnemonic => {
|
return getMnemonic().then(mnemonic => {
|
||||||
return computeOperatorId(mnemonicHelpers.toEntropyBuffer(mnemonic))
|
return computeOperatorId(mnemonicHelpers.toEntropyBuffer(mnemonic))
|
||||||
}).then(id => {
|
}).then(id => {
|
||||||
res.locals.operatorId = id
|
res.locals.operatorId = id
|
||||||
}).catch(e => console.error('Error while computing operator id\n' + e))
|
return next()
|
||||||
next()
|
}).catch(e => {
|
||||||
|
console.error('Error while computing operator id\n' + e)
|
||||||
|
next(e)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = findOperatorId
|
module.exports = findOperatorId
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue