|
5 | 5 | "fmt"
|
6 | 6 | "sync"
|
7 | 7 |
|
| 8 | + "google.golang.org/grpc/status" |
| 9 | + |
8 | 10 | "github.com/btcsuite/btclog"
|
9 | 11 | grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
10 | 12 | "github.com/lightningnetwork/lnd/lnrpc"
|
@@ -48,26 +50,26 @@ const (
|
48 | 50 | var (
|
49 | 51 | // ErrWaitingToStart is returned if LND is still wating to start,
|
50 | 52 | // possibly blocked until elected as the leader.
|
51 |
| - ErrWaitingToStart = fmt.Errorf("waiting to start, RPC services not " + |
| 53 | + ErrWaitingToStart = status.Error(1001, "waiting to start, RPC services not "+ |
52 | 54 | "available")
|
53 | 55 |
|
54 | 56 | // ErrNoWallet is returned if the wallet does not exist.
|
55 |
| - ErrNoWallet = fmt.Errorf("wallet not created, create one to enable " + |
| 57 | + ErrNoWallet = status.Error(0101, "wallet not created, create one to enable "+ |
56 | 58 | "full RPC access")
|
57 | 59 |
|
58 | 60 | // ErrWalletLocked is returned if the wallet is locked and any service
|
59 | 61 | // other than the WalletUnlocker is called.
|
60 |
| - ErrWalletLocked = fmt.Errorf("wallet locked, unlock it to enable " + |
| 62 | + ErrWalletLocked = status.Error(0102, "wallet locked, unlock it to enable "+ |
61 | 63 | "full RPC access")
|
62 | 64 |
|
63 | 65 | // ErrWalletUnlocked is returned if the WalletUnlocker service is
|
64 | 66 | // called when the wallet already has been unlocked.
|
65 |
| - ErrWalletUnlocked = fmt.Errorf("wallet already unlocked, " + |
| 67 | + ErrWalletUnlocked = status.Error(0103, "wallet already unlocked, "+ |
66 | 68 | "WalletUnlocker service is no longer available")
|
67 | 69 |
|
68 | 70 | // ErrRPCStarting is returned if the wallet has been unlocked but the
|
69 | 71 | // RPC server is not yet ready to accept calls.
|
70 |
| - ErrRPCStarting = fmt.Errorf("the RPC server is in the process of " + |
| 72 | + ErrRPCStarting = status.Error(1002, "the RPC server is in the process of "+ |
71 | 73 | "starting up, but not yet ready to accept calls")
|
72 | 74 |
|
73 | 75 | // macaroonWhitelist defines methods that we don't require macaroons to
|
|
0 commit comments