go-peer/pkg/network/message/errors.go
2024-09-17 09:46:28 +07:00

25 lines
719 B
Go

package message
const (
errPrefix = "pkg/network/message = "
)
type SMessageError struct {
str string
}
func (err *SMessageError) Error() string {
return errPrefix + err.str
}
var (
ErrUnknownType = &SMessageError{"unknown type"}
ErrInvalidHeaderSize = &SMessageError{"length of message bytes < size of header"}
ErrInvalidProofOfWork = &SMessageError{"got invalid proof of work"}
ErrDecodeBytesJoiner = &SMessageError{"decode bytes joiner"}
ErrInvalidPayloadSize = &SMessageError{"got invalid payload size"}
ErrInvalidAuthHash = &SMessageError{"got invalid auth hash"}
ErrInvalidTimestamp = &SMessageError{"got invalid timestamp"}
ErrDecodePayload = &SMessageError{"decode payload"}
)