-
Notifications
You must be signed in to change notification settings - Fork 55
maker.authenticate does not throw an error when the network is not accessible #75
Comments
Can you provide more detail about the situation? When I try this with a network address that is not listening, I get the expected output, e.g.: const Maker = require('@makerdao/dai')
const url = 'http://localhost:9999'
async function main() {
const maker = Maker.create('http', { url })
try {
await maker.authenticate()
} catch (err) {
console.log(err)
}
}
main() outputs
Does |
Thanks for creating |
alright, the fault was mine. I had copied the configuration for Maker settings for the test network from here https://github.com/makerdao/dai.js/blob/dev/test/integration/dai.spec.js#L59-L77 rather than from the official docs. W/ that configuration, |
OK, I was able to reproduce the error by slightly modifying your script. Adding privateKey to the settings caused the connection error to be dropped. the following # tmp.js
const Maker = require('@makerdao/dai')
async function main() {
//const settings = {url: 'http://localhost:2000'};
const settings = {url: 'http://localhost:2000', privateKey: '0xxxxxxx'};
const maker = Maker.create('http', settings);
try {
await maker.authenticate()
} catch (err) {
console.log(err)
}
console.log('after authentication')
}
main() outputs the following when the local 'test' network is not running $ node tmp.js
Web3 is initializing...
Web3 is connecting... note that |
interesting; i can reproduce that too. will look into it |
await maker.authenticate()
silently fails when the target network is not accessible.The text was updated successfully, but these errors were encountered: