We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you handle connection error like wrong password?
I have something like this:
const createBitcoinClient = (settings) => { try { const bitcoinClient = new bitcoin({ host: process.env.BITCOIN_NODE_HOST || '127.0.0.1', port: process.env.BITCOIN_NODE_PORT || 8332, username: process.env.BITCOIN_NODE_USER || 'bitcoin', password: process.env.BITCOIN_NODE_PASS || 'bitcoin', timeout: 30000, ssl: false, }); return bitcoinClient; } catch (error) { throw error; } };
but if the password is wrong it doesn't seem to throw the error instead the app crashes with:
node_modules/bitcoin-core/src/parser.js:57 throw new RpcError(response.statusCode, response.statusMessage, { body: response.body }); RpcError: Unauthorized at Parser.rpc (/Users/michele/Sites/futurebit/apolloapi-v2/node_modules/bitcoin-core/src/parser.js:57:13) at Client.command (/Users/michele/Sites/futurebit/apolloapi-v2/node_modules/bitcoin-core/src/index.js:157:24) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { body: '', code: 401 } Node.js v21.5.0 [nodemon] app crashed - waiting for file changes before starting...
The text was updated successfully, but these errors were encountered:
No branches or pull requests
How do you handle connection error like wrong password?
I have something like this:
but if the password is wrong it doesn't seem to throw the error instead the app crashes with:
The text was updated successfully, but these errors were encountered: