1 // Copyright (c) 2014 The btcsuite developers
2 // Use of this source code is governed by an ISC
3 // license that can be found in the LICENSE file.
7 // Standard JSON-RPC 2.0 errors.
9 ErrRPCInvalidRequest = &RPCError{
11 Message: "Invalid request",
13 ErrRPCMethodNotFound = &RPCError{
15 Message: "Method not found",
17 ErrRPCInvalidParams = &RPCError{
19 Message: "Invalid parameters",
21 ErrRPCInternal = &RPCError{
23 Message: "Internal error",
25 ErrRPCParse = &RPCError{
27 Message: "Parse error",
31 // General application defined JSON errors.
33 ErrRPCMisc RPCErrorCode = -1
34 ErrRPCForbiddenBySafeMode RPCErrorCode = -2
35 ErrRPCType RPCErrorCode = -3
36 ErrRPCInvalidAddressOrKey RPCErrorCode = -5
37 ErrRPCOutOfMemory RPCErrorCode = -7
38 ErrRPCInvalidParameter RPCErrorCode = -8
39 ErrRPCDatabase RPCErrorCode = -20
40 ErrRPCDeserialization RPCErrorCode = -22
41 ErrRPCVerify RPCErrorCode = -25
44 // Peer-to-peer client errors.
46 ErrRPCClientNotConnected RPCErrorCode = -9
47 ErrRPCClientInInitialDownload RPCErrorCode = -10
48 ErrRPCClientNodeNotAdded RPCErrorCode = -24
53 ErrRPCWallet RPCErrorCode = -4
54 ErrRPCWalletInsufficientFunds RPCErrorCode = -6
55 ErrRPCWalletInvalidAccountName RPCErrorCode = -11
56 ErrRPCWalletKeypoolRanOut RPCErrorCode = -12
57 ErrRPCWalletUnlockNeeded RPCErrorCode = -13
58 ErrRPCWalletPassphraseIncorrect RPCErrorCode = -14
59 ErrRPCWalletWrongEncState RPCErrorCode = -15
60 ErrRPCWalletEncryptionFailed RPCErrorCode = -16
61 ErrRPCWalletAlreadyUnlocked RPCErrorCode = -17
64 // Specific Errors related to commands. These are the ones a user of the RPC
65 // server are most likely to see. Generally, the codes should match one of the
66 // more general errors above.
68 ErrRPCBlockNotFound RPCErrorCode = -5
69 ErrRPCBlockCount RPCErrorCode = -5
70 ErrRPCBestBlockHash RPCErrorCode = -5
71 ErrRPCDifficulty RPCErrorCode = -5
72 ErrRPCOutOfRange RPCErrorCode = -1
73 ErrRPCNoTxInfo RPCErrorCode = -5
74 ErrRPCNoNewestBlockInfo RPCErrorCode = -5
75 ErrRPCInvalidTxVout RPCErrorCode = -5
76 ErrRPCRawTxString RPCErrorCode = -32602
77 ErrRPCDecodeHexString RPCErrorCode = -22
80 // Errors that are specific to btcd.
82 ErrRPCNoWallet RPCErrorCode = -1
83 ErrRPCUnimplemented RPCErrorCode = -1