rpc error code constants
This commit is contained in:
parent
4f2c927054
commit
bc96a3ee11
|
@ -337,7 +337,7 @@ func (c *SlotWatcher) fetchAndEmitSingleFeeReward(
|
|||
var rpcError *rpc.RPCError
|
||||
if errors.As(err, &rpcError) {
|
||||
// this is the error code for slot was skipped:
|
||||
if rpcError.Code == -32007 && strings.Contains(rpcError.Message, "skipped") {
|
||||
if rpcError.Code == rpc.SlotSkippedCode && strings.Contains(rpcError.Message, "skipped") {
|
||||
klog.Infof("slot %v was skipped, no fee rewards.", slot)
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package rpc
|
||||
|
||||
// error codes: https://github.com/anza-xyz/agave/blob/489f483e1d7b30ef114e0123994818b2accfa389/rpc-client-api/src/custom_error.rs#L17
|
||||
const (
|
||||
BlockCleanedUpCode = -32001
|
||||
SendTransactionPreflightFailureCode = -32002
|
||||
TransactionSignatureVerificationFailureCode = -32003
|
||||
BlockNotAvailableCode = -32004
|
||||
NodeUnhealthyCode = -32005
|
||||
TransactionPrecompileVerificationFailureCode = -32006
|
||||
SlotSkippedCode = -32007
|
||||
NoSnapshotCode = -32008
|
||||
LongTermStorageSlotSkippedCode = -32009
|
||||
KeyExcludedFromSecondaryIndexCode = -32010
|
||||
TransactionHistoryNotAvailableCode = -32011
|
||||
ScanErrorCode = -32012
|
||||
TransactionSignatureLengthMismatchCode = -32013
|
||||
BlockStatusNotYetAvailableCode = -32014
|
||||
UnsupportedTransactionVersionCode = -32015
|
||||
MinContextSlotNotReachedCode = -32016
|
||||
EpochRewardsPeriodActiveCode = -32017
|
||||
SlotNotEpochBoundaryCode = -32018
|
||||
)
|
Loading…
Reference in New Issue