fix: node fetching error handling
This commit is contained in:
parent
9abd8b2a88
commit
6aca242f9b
3 changed files with 20 additions and 4 deletions
|
|
@ -7,6 +7,7 @@ const request = require('request-promise')
|
|||
const { utils: coinUtils } = require('@lamassu/coins')
|
||||
|
||||
const options = require('../../options')
|
||||
const logger = require('../../logger')
|
||||
|
||||
const blockchainDir = options.blockchainDir
|
||||
|
||||
|
|
@ -116,6 +117,9 @@ function rpcConfig (cryptoRec) {
|
|||
port: config.rpcport || cryptoRec.defaultPort
|
||||
}
|
||||
} catch (err) {
|
||||
throw new Error('Wallet is currently not installed')
|
||||
logger.error('Wallet is currently not installed!')
|
||||
return {
|
||||
port: cryptoRec.defaultPort
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const { default: PQueue } = require('p-queue')
|
|||
|
||||
const BN = require('../../../bn')
|
||||
const E = require('../../../error')
|
||||
const { logger } = require('../../../blockchain/common')
|
||||
const logger = require('../../../logger')
|
||||
const options = require('../../../options')
|
||||
const jsonRpc = require('../../common/json-rpc')
|
||||
|
||||
|
|
@ -40,7 +40,12 @@ function rpcConfig () {
|
|||
port: cryptoRec.walletPort || cryptoRec.defaultPort
|
||||
}
|
||||
} catch (err) {
|
||||
throw new Error('wallet is currently not installed')
|
||||
logger.error('Wallet is currently not installed!')
|
||||
return {
|
||||
username: '',
|
||||
password: '',
|
||||
port: cryptoRec.walletPort || cryptoRec.defaultPort
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue