perrors

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnknownProtocolError = 0 // unknown error
	InvalidData          = 1
	NegativeSize         = 2
	SizeLimit            = 3
	BadVersion           = 4
	NotImplemented       = 5
	DepthLimit           = 6
)

0-6 corresponding with thrift protocol_exception

Variables

View Source
var InvalidDataLength = NewProtocolErrorWithType(InvalidData, "Invalid data length")

InvalidDataLength indicates the data length is invalid.

Functions

func IsProtocolError

func IsProtocolError(err error) bool

IsProtocolError to assert if the err is ProtocolError which has TypeId() func

func NewProtocolError

func NewProtocolError(err error) error

NewProtocolError creates a new ProtocolError wrapping the given error.

func NewProtocolErrorWithErrMsg

func NewProtocolErrorWithErrMsg(err error, errMsg string) error

NewProtocolErrorWithErrMsg to build protocolException with rawErr and errMsg

func NewProtocolErrorWithMsg

func NewProtocolErrorWithMsg(errMsg string) error

NewProtocolErrorWithMsg to build protocolException with errMsg

Types

type ProtocolError

type ProtocolError interface {
	error
	TypeId() int
}

ProtocolError indicates an protocol error has occurred.

func NewProtocolErrorWithType

func NewProtocolErrorWithType(errType int, errMsg string) ProtocolError

NewProtocolErrorWithType to build protocolException with errType and errMsg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL