Documentation ¶
Index ¶
- Constants
- func As(err error, targets ...interface{}) bool
- func Check(err error) (statusCode int64, operationStatus OperationStatus, backoff BackoffType, ...)
- func ErrIf(cond bool, err error) error
- func FromGRPCError(err error, opts ...teOpt) error
- func FromOperation(operation operation) 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 MustPessimizeEndpoint(err error, codes ...grpcCodes.Code) bool
- func New(err error) error
- func NewWithIssues(text string, issues ...error) error
- func Operation(opts ...oeOpt) error
- func RetryableError(err error, opts ...RetryableErrorOption) error
- func Transport(opts ...teOpt) error
- func WithAddress(address string) teOpt
- func WithCode(code grpcCodes.Code) 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
- type BackoffType
- type Error
- type Issue
- type IssueIterator
- type OperationStatus
- type RetryType
- type RetryableErrorOption
Constants ¶
const ( OperationFinished = OperationStatus(1 << iota >> 1) OperationStatusUndefined // may be true or may be false OperationNotFinished )
Binary flags that used as OperationStatus
Variables ¶
This section is empty.
Functions ¶
func Check ¶ added in v3.16.9
func Check(err error) ( statusCode int64, operationStatus OperationStatus, backoff BackoffType, deleteSession bool, )
Check returns retry mode for err.
func FromGRPCError ¶ added in v3.16.8
func FromOperation ¶ added in v3.16.9
func FromOperation(operation operation) oeOpt
FromOperation is an option for construct operation error from operation FromOperation must use as `Operation(FromOperation(operation))`
func IsOperationError ¶ added in v3.16.9
func IsOperationError(err error, codes ...Ydb.StatusIds_StatusCode) bool
IsOperationError reports whether err is operationError with given status codes.
func IsTimeoutError ¶
func IsTransportError ¶
IsTransportError reports whether err is transportError with given grpc codes
func IterateByIssues ¶ added in v3.16.9
func IterateByIssues(err error, it func(message string, code Ydb.StatusIds_StatusCode, severity uint32))
func NewWithIssues ¶ added in v3.5.2
NewWithIssues returns error which contains child issues
func RetryableError ¶ added in v3.7.0
func RetryableError(err error, opts ...RetryableErrorOption) error
func Transport ¶ added in v3.16.10
func Transport(opts ...teOpt) error
Transport returns a new transport error with given options
func WithAddress ¶ added in v3.16.9
func WithAddress(address string) teOpt
func WithIssues ¶ added in v3.16.9
func WithIssues(issues []*Ydb_Issue.IssueMessage) oeOpt
WithIssues is an option for construct operation error with issues list WithIssues must use as `Operation(WithIssues(issues))`
func WithSkipDepth ¶ added in v3.15.0
func WithSkipDepth(skipDepth int) withStackTraceOption
func WithStackTrace ¶ added in v3.15.0
WithStackTrace is a wrapper over original err with file:line identification
func WithStatusCode ¶ added in v3.16.9
func WithStatusCode(code Ydb.StatusIds_StatusCode) oeOpt
WithStatusCode is an option for construct operation error with reason code WithStatusCode must use as `Operation(WithStatusCode(reason))`
Types ¶
type BackoffType ¶
type BackoffType uint8
BackoffType reports how to Backoff operation
const ( BackoffTypeNoBackoff BackoffType = 1 << iota >> 1 BackoffTypeFastBackoff BackoffTypeSlowBackoff BackoffTypeBackoffAny = BackoffTypeFastBackoff | BackoffTypeSlowBackoff )
Binary flags that used as BackoffType
func (BackoffType) String ¶
func (b BackoffType) String() string
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 OperationStatus ¶ added in v3.7.0
type OperationStatus uint8
OperationStatus reports which status of operation: completed or none
func (OperationStatus) String ¶ added in v3.7.0
func (t OperationStatus) String() string
type RetryableErrorOption ¶ added in v3.16.10
type RetryableErrorOption func(e *retryableError)
func WithBackoff ¶ added in v3.16.10
func WithBackoff(t BackoffType) RetryableErrorOption
func WithDeleteSession ¶ added in v3.16.10
func WithDeleteSession() RetryableErrorOption