Documentation ¶
Index ¶
- Constants
- func As(err error, targets ...interface{}) bool
- func ErrIf(cond bool, err error) error
- func Errorf(format string, args ...interface{}) *multiErrorf
- func FromOperation(operation operationStatus) oeOpt
- func HideEOF(err error) error
- func Is(err error, targets ...error) bool
- func IsOperationError(err error, codes ...Ydb.StatusIds_StatusCode) bool
- func IsTimeoutError(err error) bool
- func IsTransportError(err error, codes ...grpcCodes.Code) bool
- func IsYdb(err error) bool
- func IterateByIssues(err error, ...)
- func MustDeleteSession(err error) bool
- func MustPessimizeEndpoint(err error, codes ...grpcCodes.Code) bool
- func NewWithIssues(text string, issues ...error) error
- func Operation(opts ...oeOpt) error
- func Retryable(err error, opts ...RetryableErrorOption) error
- func StackRecord(depth int) string
- func Transport(err error, opts ...teOpt) error
- func WithAddress(address string) teOpt
- func WithIssues(issues []*Ydb_Issue.IssueMessage) oeOpt
- func WithSkipDepth(skipDepth int) withStackTraceOption
- func WithStackTrace(err error, opts ...withStackTraceOption) error
- func WithStatusCode(code Ydb.StatusIds_StatusCode) oeOpt
- func Wrap(err error) error
- type Error
- type Issue
- type IssueIterator
- type RetryableErrorOption
- type Type
Constants ¶
const ( TypeUndefined = Type(iota) TypeNoError TypeNonRetryable TypeConditionallyRetryable TypeRetryable )
Variables ¶
This section is empty.
Functions ¶
func FromOperation ¶
func FromOperation(operation operationStatus) oeOpt
FromOperation is an option for construct operationStatus error from operationStatus FromOperation must use as `Operation(FromOperation(operationStatus))`
func IsOperationError ¶
func IsOperationError(err error, codes ...Ydb.StatusIds_StatusCode) bool
IsOperationError reports whether err is operationError with given errType codes.
func IsTimeoutError ¶
func IsTransportError ¶
IsTransportError reports whether err is transportError with given grpc codes
func IterateByIssues ¶
func IterateByIssues(err error, it func(message string, code Ydb.StatusIds_StatusCode, severity uint32))
func MustDeleteSession ¶ added in v3.42.0
func NewWithIssues ¶
NewWithIssues returns error which contains child issues
func Retryable ¶ added in v3.21.0
func Retryable(err error, opts ...RetryableErrorOption) error
func StackRecord ¶ added in v3.34.0
func WithAddress ¶
func WithAddress(address string) teOpt
func WithIssues ¶
func WithIssues(issues []*Ydb_Issue.IssueMessage) oeOpt
WithIssues is an option for construct operationStatus error with issues list WithIssues must use as `Operation(WithIssues(issues))`
func WithSkipDepth ¶
func WithSkipDepth(skipDepth int) withStackTraceOption
func WithStackTrace ¶
WithStackTrace is a wrapper over original err with file:line identification
func WithStatusCode ¶
func WithStatusCode(code Ydb.StatusIds_StatusCode) oeOpt
WithStatusCode is an option for construct operationStatus error with reason code WithStatusCode must use as `Operation(WithStatusCode(reason))`
Types ¶
type Error ¶
type Error interface { error Code() int32 Name() string Type() Type BackoffType() backoff.Type MustDeleteSession() bool }
Error is an interface of error which reports about error code and error name.
func OperationError ¶
func RetryableError ¶
RetryableError return Error if err is retriable error, else nil
func TransportError ¶
type IssueIterator ¶
type IssueIterator []*Ydb_Issue.IssueMessage
func (IssueIterator) Get ¶
func (it IssueIterator) Get(i int) (issue Issue, nested IssueIterator)
func (IssueIterator) Len ¶
func (it IssueIterator) Len() int
type RetryableErrorOption ¶
type RetryableErrorOption func(e *retryableError)
func WithBackoff ¶
func WithBackoff(t backoff.Type) RetryableErrorOption
func WithDeleteSession ¶
func WithDeleteSession() RetryableErrorOption
func WithName ¶ added in v3.21.0
func WithName(name string) RetryableErrorOption