error_util

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 8 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FailoverSuccessError = &AwsWrapperError{GetMessage("Failover.connectionChangedError"), FailoverSuccessErrorType}
View Source
var InternalQueryTimeoutError = &AwsWrapperError{GetMessage("Failover.timeoutError"), InternalQueryTimeoutErrorType}
View Source
var LocalizerMutex = &sync.Mutex{}
View Source
var ShouldNotBeCalledError = &AwsWrapperError{Message: "Shouldn't be called.", ErrorType: GenericAwsWrapperErrorType}
View Source
var TransactionResolutionUnknownError = &AwsWrapperError{
	GetMessage("Failover.transactionResolutionUnknownError"),
	TransactionResolutionUnknownErrorType}

Functions

func GetMessage

func GetMessage(messageId string, messageArgs ...any) string

func IsType

func IsType(err error, errorType AwsWrapperErrorType) bool

Types

type AwsWrapperError

type AwsWrapperError struct {
	Message   string
	ErrorType AwsWrapperErrorType
}

func NewDsnParsingError

func NewDsnParsingError(message string) *AwsWrapperError

func NewFailoverFailedError

func NewFailoverFailedError(message string) *AwsWrapperError

func NewGenericAwsWrapperError

func NewGenericAwsWrapperError(message string) *AwsWrapperError

func NewIllegalArgumentError

func NewIllegalArgumentError(message string) *AwsWrapperError

func NewLoginError

func NewLoginError(message string) *AwsWrapperError

func NewTimeoutError

func NewTimeoutError(message string) *AwsWrapperError

func NewUnavailableHostError

func NewUnavailableHostError(host string) *AwsWrapperError

func NewUnsupportedMethodError

func NewUnsupportedMethodError(method string, object string) *AwsWrapperError

func NewUnsupportedStrategyError

func NewUnsupportedStrategyError(message string) *AwsWrapperError

func (*AwsWrapperError) Error

func (a *AwsWrapperError) Error() string

func (*AwsWrapperError) IsFailoverErrorType

func (a *AwsWrapperError) IsFailoverErrorType() bool

func (*AwsWrapperError) IsType

func (a *AwsWrapperError) IsType(errorType AwsWrapperErrorType) bool

type AwsWrapperErrorType

type AwsWrapperErrorType int
const (
	GenericAwsWrapperErrorType            AwsWrapperErrorType = 0
	UnsupportedStrategyErrorType          AwsWrapperErrorType = 1
	UnsupportedMethodErrorType            AwsWrapperErrorType = 2
	IllegalArgumentErrorType              AwsWrapperErrorType = 3
	LoginErrorType                        AwsWrapperErrorType = 4
	InternalQueryTimeoutErrorType         AwsWrapperErrorType = 5
	UnavailableHostErrorType              AwsWrapperErrorType = 6
	DsnParsingErrorType                   AwsWrapperErrorType = 7
	TimeoutErrorType                      AwsWrapperErrorType = 8
	FailoverSuccessErrorType              AwsWrapperErrorType = 300
	FailoverFailedErrorType               AwsWrapperErrorType = 301
	TransactionResolutionUnknownErrorType AwsWrapperErrorType = 302
)

type ErrorHandler

type ErrorHandler interface {
	IsNetworkError(err error) bool
	IsLoginError(err error) bool
}

Jump to

Keyboard shortcuts

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