Merge pull request #1242 from chaotixkilla/fix-machine-crash-with-disconnected-node
Fix machine crashing with disconnected nodes
This commit is contained in:
commit
67e21d202f
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ import { primaryColor } from 'src/styling/variables'
|
|||
|
||||
import styles from './Funding.styles'
|
||||
|
||||
const NODE_NOT_CONNECTED_ERR =
|
||||
"Couldn't establish connection with the node. Make sure it is installed and try again"
|
||||
|
||||
const useStyles = makeStyles(styles)
|
||||
const sizes = {
|
||||
big: 165,
|
||||
|
|
@ -176,7 +179,11 @@ const Funding = () => {
|
|||
{selected && !viewHistory && selected.errorMsg && (
|
||||
<div className={classes.main}>
|
||||
<div className={classes.firstSide}>
|
||||
<Info3 className={classes.error}>{selected.errorMsg}</Info3>
|
||||
<Info3 className={classes.error}>
|
||||
{R.includes('ECONNREFUSED', selected.errorMsg)
|
||||
? NODE_NOT_CONNECTED_ERR
|
||||
: selected.errorMsg}
|
||||
</Info3>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue