github.com/ava-labs/avalanchego@v1.11.11/network/p2p/error.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package p2p
     5  
     6  import "github.com/ava-labs/avalanchego/snow/engine/common"
     7  
     8  var (
     9  	// ErrUnexpected should be used to indicate that a request failed due to a
    10  	// generic error
    11  	ErrUnexpected = &common.AppError{
    12  		Code:    -1,
    13  		Message: "unexpected error",
    14  	}
    15  	// ErrUnregisteredHandler should be used to indicate that a request failed
    16  	// due to it not matching a registered handler
    17  	ErrUnregisteredHandler = &common.AppError{
    18  		Code:    -2,
    19  		Message: "unregistered handler",
    20  	}
    21  	// ErrNotValidator should be used to indicate that a request failed due to
    22  	// the requesting peer not being a validator
    23  	ErrNotValidator = &common.AppError{
    24  		Code:    -3,
    25  		Message: "not a validator",
    26  	}
    27  	// ErrThrottled should be used to indicate that a request failed due to the
    28  	// requesting peer exceeding a rate limit
    29  	ErrThrottled = &common.AppError{
    30  		Code:    -4,
    31  		Message: "throttled",
    32  	}
    33  )