flocore-node/lib/errors.js
Chris Kleeschulte 4ee11ed73b Crash on reindex
- Introduced the concept of a Cancellation error so that services can choose to watch for a cancellation flag. 
- Services can then send this error back and it will be forwarded to the node.
- The node will then know to call shutdown appropriately.
2015-09-16 10:22:42 -04:00

29 lines
874 B
JavaScript

'use strict';
var createError = require('errno').create;
var BitcoreNodeError = createError('BitcoreNodeError');
var NoOutputs = createError('NoOutputs', BitcoreNodeError);
var NoOutput = createError('NoOutput', BitcoreNodeError);
var Wallet = createError('WalletError', BitcoreNodeError);
Wallet.InsufficientFunds = createError('InsufficientFunds', Wallet);
var Consensus = createError('Consensus', BitcoreNodeError);
Consensus.BlockExists = createError('BlockExists', Consensus);
var Transaction = createError('Transaction', BitcoreNodeError);
Transaction.NotFound = createError('NotFound', Transaction);
var Cancellation = createError('Cancellation', BitcoreNodeError);
module.exports = {
Error: BitcoreNodeError,
NoOutputs: NoOutputs,
NoOutput: NoOutput,
Wallet: Wallet,
Consensus: Consensus,
Transaction: Transaction,
Cancellation: Cancellation
};