Closed joemphilips closed 7 years ago
@joemphilips if you assign the promise chain to a variable and inspect it, you'll see that the returned value is a Promise
. It is fully supported and is the preferred method of interacting with the library.
const promise = bitcoindclient.sendToAddress("foo", 0.01, "This is message", "and comment.")
.catch((err) => console.log(err))
console.log(promise);
I'm unable to reproduce this. In fact, the error that I receive is Invalid Bitcoin address
and not Invalid amount for send
, which appears to be the expected one as the first argument to be validated is the bitcoin address.
What happens if you use:
bitcoindclient.sendToAddress("mqs2cd6T2GdkqczAHK3kcnXTnrqVLEuR5o", "foo", "This is message", "and comment.")
Also, which node and bitcoind versions are you using? Closing issue, but will re-open if bug is confirmed.
To reproduce
What I expect to happen is that function inside
.catch()
to be triggered since the first argument tosendToAddress
is invalid. It will cause RpcError as expected, but can not catch the error. It will shows following stacktrace.So what should I do to catch the error?
Promise
feature is not supported for this library?