package xerrors
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
Index ¶
- Constants
- func As(err error, targets ...interface{}) bool
- func ErrIf(cond bool, err error) error
- func FromOperation(operation operation.Status) *operationOption
- func HideEOF(err error) error
- func Is(err error, targets ...error) bool
- func IsContextError(err error) bool
- func IsErrorFromServer(err error) bool
- func IsOperationError(err error, codes ...Ydb.StatusIds_StatusCode) bool
- func IsOperationErrorTransactionLocksInvalidated(err error) (isTLI bool)
- func IsRetryObjectValid(err error) bool
- func IsTimeoutError(err error) bool
- func IsTransportError(err error, codes ...grpcCodes.Code) bool
- func IsYdb(err error) bool
- func IterateByIssues(err error, it func(message string, code Ydb.StatusIds_StatusCode, severity uint32))
- func Join(errs ...error) *joinError
- 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 Transport(err error, opts ...teOpt) error
- func WithAddress(address string) addressOption
- func WithIssues(issues []*Ydb_Issue.IssueMessage) issuesOption
- func WithSkipDepth(skipDepth int) withStackTraceOption
- func WithStackTrace(err error, opts ...withStackTraceOption) error
- func WithStatusCode(code Ydb.StatusIds_StatusCode) statusCodeOption
- func WithTraceID(traceID string) traceIDOption
- func Wrap(err error) error
- type Error
- func OperationError(err error) Error
- func RetryableError(err error) Error
- func TransportError(err error) Error
- type Issue
- type IssueIterator
- func (it IssueIterator) Get(i int) (issue Issue, nested IssueIterator)
- func (it IssueIterator) Len() int
- type RetryableErrorOption
- func InvalidObject() RetryableErrorOption
- func WithBackoff(t backoff.Type) RetryableErrorOption
- func WithName(name string) RetryableErrorOption
- type Type
Constants ¶
const ( TypeUndefined = Type(iota) TypeNoError TypeNonRetryable TypeConditionallyRetryable TypeRetryable )
Functions ¶
func As ¶
As is a proxy to errors.As This need to single import errors
func ErrIf ¶
func FromOperation ¶
FromOperation is an option for construct operation error from operation.Status FromOperation must use as `Operation(FromOperation(operation.Status))`
func HideEOF ¶
func Is ¶
Is is a improved proxy to errors.Is This need to single import errors
func IsContextError ¶
func IsErrorFromServer ¶
IsErrorFromServer return true if err returned from server (opposite to raised internally in sdk)
func IsOperationError ¶
func IsOperationError(err error, codes ...Ydb.StatusIds_StatusCode) bool
IsOperationError reports whether err is operationError with given errType codes.
func IsOperationErrorTransactionLocksInvalidated ¶
func IsRetryObjectValid ¶
func IsTimeoutError ¶
func IsTransportError ¶
IsTransportError reports whether err is transportError with given grpc codes
func IsYdb ¶
func IterateByIssues ¶
func IterateByIssues(err error, it func(message string, code Ydb.StatusIds_StatusCode, severity uint32))
func Join ¶
func Join(errs ...error) *joinError
func MustPessimizeEndpoint ¶
func NewWithIssues ¶
NewWithIssues returns error which contains child issues
func Operation ¶
func Operation(opts ...oeOpt) error
func Retryable ¶
func Retryable(err error, opts ...RetryableErrorOption) error
func Transport ¶
Transport returns a new transport error with given options
func WithAddress ¶
func WithAddress(address string) addressOption
func WithIssues ¶
func WithIssues(issues []*Ydb_Issue.IssueMessage) issuesOption
WithIssues is an option for construct operation 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) statusCodeOption
WithStatusCode is an option for construct operation error with reason code WithStatusCode must use as `Operation(WithStatusCode(reason))`
func WithTraceID ¶
func WithTraceID(traceID string) traceIDOption
WithTraceID is an option for construct operation error with traceID
func Wrap ¶
Wrap makes internal ydb error
Types ¶
type Error ¶
type Error interface { error Code() int32 Name() string Type() Type BackoffType() backoff.Type IsRetryObjectValid() 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 Issue ¶
Issue struct
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 InvalidObject ¶
func InvalidObject() RetryableErrorOption
func WithBackoff ¶
func WithBackoff(t backoff.Type) RetryableErrorOption
func WithName ¶
func WithName(name string) RetryableErrorOption
type Type ¶
type Type uint8
Type reports which error type
func Check ¶
Check returns retry mode for err.
func (Type) String ¶
Source Files ¶
check.go issues.go join.go operation.go retryable.go stacktrace.go transport.go type.go xerrors.go ydb.go
- Version
- v3.66.0
- Published
- Apr 23, 2024
- Platform
- linux/amd64
- Imports
- 15 packages
- Last checked
- 1 minute ago –
Tools for package owners.