sparkerrors

package
v35.0.0-...-df5103f Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConnectionError               = errorType(errors.New("connection error"))
	ReadError                     = errorType(errors.New("read error"))
	ExecutionError                = errorType(errors.New("execution error"))
	InvalidInputError             = errorType(errors.New("invalid input"))
	InvalidPlanError              = errorType(errors.New("invalid plan"))
	RetriesExceeded               = errorType(errors.New("retries exceeded"))
	InvalidServerSideSessionError = errorType(errors.New("invalid server side session"))
	TestSetupError                = errorType(errors.New("test setup error"))
	WriteError                    = errorType(errors.New("write error"))
	NotImplementedError           = errorType(errors.New("not implemented"))
	InvalidArgumentError          = errorType(errors.New("invalid argument"))
)

Functions

func WithString

func WithString(err error, errMsg string) error

func WithStringf

func WithStringf(err error, errMsg string, params ...any) error

func WithType

func WithType(err error, errType errorType) error

WithType wraps an error with a type that can later be checked using `errors.Is`

Types

type InvalidServerSideSessionDetailsError

type InvalidServerSideSessionDetailsError struct {
	OwnSessionId      string
	ReceivedSessionId string
}

func (InvalidServerSideSessionDetailsError) Error

type SparkError

type SparkError struct {
	// SqlState is the SQL state of the error.
	SqlState string
	// ErrorClass is the class of the error.
	ErrorClass string
	// If set is typically the classname throwing the error on the Spark side.
	Reason string
	// Message is the human-readable message of the error.
	Message string
	// Code is the gRPC status code of the error.
	Code codes.Code
	// ErrorId is the unique id of the error. It can be used to fetch more details about
	// the error using an additional RPC from the server.
	ErrorId string
	// Parameters are the parameters that are used to format the error message.
	Parameters map[string]string
	// contains filtered or unexported fields
}

SparkError represents an error that is returned from Spark itself. It captures details of the error that allows better understanding about the error. This allows us to check if the error can be retried or not.

func FromRPCError

func FromRPCError(e error) *SparkError

FromRPCError converts a gRPC error to a SparkError. If the error is not a gRPC error, it will create a plain "UNKNOWN" GRPC status type. If no error was observed returns nil.

func (SparkError) Error

func (e SparkError) Error() string

type UnsupportedResponseTypeError

type UnsupportedResponseTypeError struct {
	ResponseType interface{}
}

func (UnsupportedResponseTypeError) Error

Jump to

Keyboard shortcuts

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