yterrors

package
v0.0.0-...-5019c65 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Code generated by yt-gen-error-code. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsAlreadyExistsError

func ContainsAlreadyExistsError(err error) bool

ContainsAlreadyExistsError is convenient helper for checking AlreadyExistsError.

func ContainsErrorCode

func ContainsErrorCode(err error, code ErrorCode) bool

ContainsErrorCode returns true iff any of the nested errors has ErrorCode equal to errorCode.

ContainsErrorCode invokes errors.As internally. It is safe to pass arbitrary error value to this function.

func ContainsMessageRE

func ContainsMessageRE(err error, messageRE *regexp.Regexp) bool

ContainsMessageRE returns true iff any of the nested errors has message matching provided regex.

Use of this function is strongly discouraged, use ContainsErrorCode when possible.

func ContainsResolveError

func ContainsResolveError(err error) bool

ContainsResolveError is convenient helper for checking ResolveError.

func Err

func Err(args ...interface{}) error

Err creates new error of type Error.

NOTE: when passing multiple inner errors, only the last one will be accessible by errors.Is and errors.As.

func FromError

func FromError(err error) error

FromError converts any error to YT error, if it not already YT error.

If err implement Converter interface, FromError calls YTError() method of err and returns the result.

Nested errors are converted to nested YT errors.

err is stored internally and is accessible using errors.As and errors.Is. Original error is discarded during serialization.

If err is already a YT error, returns err unmodified.

Types

type Converter

type Converter interface {
	YTError() *Error
}

Converter is interface that might be implemented by error type that wish to implement custom conversion to *Error.

type Error

type Error struct {
	Code       ErrorCode              `yson:"code" json:"code"`
	Message    string                 `yson:"message" json:"message"`
	Attributes map[string]interface{} `yson:"attributes,omitempty" json:"attributes,omitempty"`

	// NOTE: Unwrap() always returns last inner error.
	InnerErrors []*Error `yson:"inner_errors,omitempty" json:"inner_errors,omitempty"`
	// contains filtered or unexported fields
}

Error is an implementation of built-in go error interface.

YT errors are designed to be easily transferred over network and between different languages. Because of this, Error is a concrete type and not an interface.

YT error consists of error code, error message, list of attributes and a list of inner errors.

Since YT error might contain arbitrary nested tree structure, user should traverse the whole tree when searching for a specific error condition.

Error supports brief and full formatting using %v and %+v format specifiers.

func FindErrorCode

func FindErrorCode(err error, code ErrorCode) *Error

FindErrorCode examines error and all nested errors, returning first YT error with given error code.

func (*Error) AddAttr

func (yt *Error) AddAttr(name string, value interface{})

func (*Error) As

func (yt *Error) As(target interface{}) bool

func (*Error) Error

func (yt *Error) Error() string

func (*Error) Format

func (yt *Error) Format(s fmt.State, v rune)

func (*Error) FormatError

func (yt *Error) FormatError(p errors.Printer) (next error)

func (*Error) HasAttr

func (yt *Error) HasAttr(name string) bool

func (*Error) Is

func (yt *Error) Is(target error) bool

func (*Error) MarshalJSON

func (yt *Error) MarshalJSON() ([]byte, error)

MarshalJSON copies json serialization logic from C++ code.

All non-ascii bytes inside strings are interpreted as runes and encoded using utf8 encoding (even if they already form a valid utf-8 sequence of bytes).

func (*Error) UnmarshalJSON

func (yt *Error) UnmarshalJSON(b []byte) error

UnmarshalJSON copies json deserialization logic from C++ code.

func (*Error) Unwrap

func (yt *Error) Unwrap() error

Unwrap always returns last inner error.

type ErrorAttr

type ErrorAttr struct {
	Name  string
	Value interface{}
}

func Attr

func Attr(name string, value interface{}) ErrorAttr

type ErrorCode

type ErrorCode int
const (
	CodeOK                                     ErrorCode = 0
	CodeGeneric                                ErrorCode = 1
	CodeCanceled                               ErrorCode = 2
	CodeTimeout                                ErrorCode = 3
	CodeFutureCombinerFailure                  ErrorCode = 4
	CodeFutureCombinerShortcut                 ErrorCode = 5
	CodeTransportError                         ErrorCode = 100
	CodeProtocolError                          ErrorCode = 101
	CodeNoSuchService                          ErrorCode = 102
	CodeNoSuchMethod                           ErrorCode = 103
	CodeUnavailable                            ErrorCode = 105
	CodePoisonPill                             ErrorCode = 106
	CodeRPCRequestQueueSizeLimitExceeded       ErrorCode = 108
	CodeRPCAuthenticationError                 ErrorCode = 109
	CodeInvalidCsrfToken                       ErrorCode = 110
	CodeInvalidCredentials                     ErrorCode = 111
	CodeStreamingNotSupported                  ErrorCode = 112
	CodeUnsupportedClientFeature               ErrorCode = 113
	CodeUnsupportedServerFeature               ErrorCode = 114
	CodePeerBanned                             ErrorCode = 115
	CodeNoSuchOperation                        ErrorCode = 200
	CodeInvalidOperationState                  ErrorCode = 201
	CodeTooManyOperations                      ErrorCode = 202
	CodeNoSuchJob                              ErrorCode = 203
	CodeOperationFailedOnJobRestart            ErrorCode = 210
	CodeOperationFailedWithInconsistentLocking ErrorCode = 211
	CodeOperationControllerCrashed             ErrorCode = 212
	CodeTestingError                           ErrorCode = 213
	CodePoolTreesAreUnspecified                ErrorCode = 214
	CodeMaxFailedJobsLimitExceeded             ErrorCode = 215
	CodeOperationFailedToPrepare               ErrorCode = 216
	CodeWatcherHandlerFailed                   ErrorCode = 217
	CodeMasterDisconnected                     ErrorCode = 218
	CodeSortOrderViolation                     ErrorCode = 301
	CodeInvalidDoubleValue                     ErrorCode = 302
	CodeIncomparableType                       ErrorCode = 303
	CodeUnhashableType                         ErrorCode = 304
	CodeCorruptedNameTable                     ErrorCode = 305
	CodeUniqueKeyViolation                     ErrorCode = 306
	CodeSchemaViolation                        ErrorCode = 307
	CodeRowWeightLimitExceeded                 ErrorCode = 308
	CodeInvalidColumnFilter                    ErrorCode = 309
	CodeInvalidColumnRenaming                  ErrorCode = 310
	CodeIncompatibleKeyColumns                 ErrorCode = 311
	CodeReaderDeadlineExpired                  ErrorCode = 312
	CodeTimestampOutOfRange                    ErrorCode = 313
	CodeInvalidSchemaValue                     ErrorCode = 314
	CodeFormatCannotRepresentRow               ErrorCode = 315
	CodeIncompatibleSchemas                    ErrorCode = 316
	CodeSameTransactionLockConflict            ErrorCode = 400
	CodeDescendantTransactionLockConflict      ErrorCode = 401
	CodeConcurrentTransactionLockConflict      ErrorCode = 402
	CodePendingLockConflict                    ErrorCode = 403
	CodeLockDestroyed                          ErrorCode = 404
	CodeResolveError                           ErrorCode = 500
	CodeAlreadyExists                          ErrorCode = 501
	CodeMaxChildCountViolation                 ErrorCode = 502
	CodeMaxStringLengthViolation               ErrorCode = 503
	CodeMaxAttributeSizeViolation              ErrorCode = 504
	CodeMaxKeyLengthViolation                  ErrorCode = 505
	CodeNoSuchSnapshot                         ErrorCode = 600
	CodeNoSuchChangelog                        ErrorCode = 601
	CodeInvalidEpoch                           ErrorCode = 602
	CodeInvalidVersion                         ErrorCode = 603
	CodeOutOfOrderMutations                    ErrorCode = 609
	CodeInvalidSnapshotVersion                 ErrorCode = 610
	CodeReadOnlySnapshotBuilt                  ErrorCode = 611
	CodeReadOnlySnapshotBuildFailed            ErrorCode = 612
	CodeBrokenChangelog                        ErrorCode = 613
	CodeChangelogIOError                       ErrorCode = 614
	CodeInvalidChangelogState                  ErrorCode = 615
	CodeAllTargetNodesFailed                   ErrorCode = 700
	CodeSendBlocksFailed                       ErrorCode = 701
	CodeNoSuchSession                          ErrorCode = 702
	CodeSessionAlreadyExists                   ErrorCode = 703
	CodeChunkAlreadyExists                     ErrorCode = 704
	CodeWindowError                            ErrorCode = 705
	CodeBlockContentMismatch                   ErrorCode = 706
	CodeNoSuchBlock                            ErrorCode = 707
	CodeNoSuchChunk                            ErrorCode = 708
	CodeNoLocationAvailable                    ErrorCode = 710
	CodeIOError                                ErrorCode = 711
	CodeMasterCommunicationFailed              ErrorCode = 712
	CodeNoSuchChunkTree                        ErrorCode = 713
	CodeMasterNotConnected                     ErrorCode = 714
	CodeChunkUnavailable                       ErrorCode = 716
	CodeNoSuchChunkList                        ErrorCode = 717
	CodeWriteThrottlingActive                  ErrorCode = 718
	CodeNoSuchMedium                           ErrorCode = 719
	CodeOptimisticLockFailure                  ErrorCode = 720
	CodeInvalidBlockChecksum                   ErrorCode = 721
	CodeBlockOutOfRange                        ErrorCode = 722
	CodeMissingExtension                       ErrorCode = 724
	CodeBandwidthThrottlingFailed              ErrorCode = 725
	CodeReaderTimeout                          ErrorCode = 726
	CodeNoSuchChunkView                        ErrorCode = 727
	CodeIncorrectChunkFileChecksum             ErrorCode = 728
	CodeIncorrectChunkFileHeaderSignature      ErrorCode = 729
	CodeIncorrectLayerFileSize                 ErrorCode = 730
	CodeNoSpaceLeftOnDevice                    ErrorCode = 731
	CodeConcurrentChunkUpdate                  ErrorCode = 732
	CodeInvalidElectionState                   ErrorCode = 800
	CodeInvalidLeader                          ErrorCode = 801
	CodeInvalidElectionEpoch                   ErrorCode = 802
	CodeAuthenticationError                    ErrorCode = 900
	CodeAuthorizationError                     ErrorCode = 901
	CodeAccountLimitExceeded                   ErrorCode = 902
	CodeUserBanned                             ErrorCode = 903
	CodeRequestQueueSizeLimitExceeded          ErrorCode = 904
	CodeNoSuchAccount                          ErrorCode = 905
	CodeSafeModeEnabled                        ErrorCode = 906
	CodeNoSuchSubject                          ErrorCode = 907
	CodePrerequisiteCheckFailed                ErrorCode = 1000
	CodeInvalidObjectLifeStage                 ErrorCode = 1001
	CodeCrossCellAdditionalPath                ErrorCode = 1002
	CodeCrossCellRevisionPrerequisitePath      ErrorCode = 1003
	CodeForwardedRequestFailed                 ErrorCode = 1004
	CodeCannotCacheMutatingRequest             ErrorCode = 1005
	CodeConfigCreationFailed                   ErrorCode = 1100
	CodeAbortByScheduler                       ErrorCode = 1101
	CodeResourceOverdraft                      ErrorCode = 1102
	CodeWaitingJobTimeout                      ErrorCode = 1103
	CodeSlotNotFound                           ErrorCode = 1104
	CodeJobEnvironmentDisabled                 ErrorCode = 1105
	CodeJobProxyConnectionFailed               ErrorCode = 1106
	CodeArtifactCopyingFailed                  ErrorCode = 1107
	CodeNodeDirectoryPreparationFailed         ErrorCode = 1108
	CodeSlotLocationDisabled                   ErrorCode = 1109
	CodeQuotaSettingFailed                     ErrorCode = 1110
	CodeRootVolumePreparationFailed            ErrorCode = 1111
	CodeNotEnoughDiskSpace                     ErrorCode = 1112
	CodeArtifactDownloadFailed                 ErrorCode = 1113
	CodeJobProxyPreparationTimeout             ErrorCode = 1114
	CodeJobPreparationTimeout                  ErrorCode = 1115
	CodeJobProxyFailed                         ErrorCode = 1120
	CodeSetupCommandFailed                     ErrorCode = 1121
	CodeGpuLayerNotFetched                     ErrorCode = 1122
	CodeGpuJobWithoutLayers                    ErrorCode = 1123
	CodeTmpfsOverflow                          ErrorCode = 1124
	CodeGpuCheckCommandFailed                  ErrorCode = 1125
	CodeGpuCheckCommandIncorrect               ErrorCode = 1126
	CodeMemoryLimitExceeded                    ErrorCode = 1200
	CodeMemoryCheckFailed                      ErrorCode = 1201
	CodeJobTimeLimitExceeded                   ErrorCode = 1202
	CodeUnsupportedJobType                     ErrorCode = 1203
	CodeJobNotPrepared                         ErrorCode = 1204
	CodeUserJobFailed                          ErrorCode = 1205
	CodeUserJobProducedCoreFiles               ErrorCode = 1206
	CodeLocalChunkReaderFailed                 ErrorCode = 1300
	CodeLayerUnpackingFailed                   ErrorCode = 1301
	CodeNodeDecommissioned                     ErrorCode = 1401
	CodeNodeBanned                             ErrorCode = 1402
	CodeNodeTabletSlotsDisabled                ErrorCode = 1403
	CodeNodeFilterMismatch                     ErrorCode = 1404
	CodeCellDidNotAppearWithinTimeout          ErrorCode = 1405
	CodeAborted                                ErrorCode = 1500
	CodeResolveTimedOut                        ErrorCode = 1501
	CodeNoSuchNode                             ErrorCode = 1600
	CodeInvalidState                           ErrorCode = 1601
	CodeNoSuchNetwork                          ErrorCode = 1602
	CodeNoSuchRack                             ErrorCode = 1603
	CodeNoSuchDataCenter                       ErrorCode = 1604
	CodeTransactionLockConflict                ErrorCode = 1700
	CodeNoSuchTablet                           ErrorCode = 1701
	CodeTabletNotMounted                       ErrorCode = 1702
	CodeAllWritesDisabled                      ErrorCode = 1703
	CodeInvalidMountRevision                   ErrorCode = 1704
	CodeTableReplicaAlreadyExists              ErrorCode = 1705
	CodeInvalidTabletState                     ErrorCode = 1706
	CodeTableMountInfoNotReady                 ErrorCode = 1707
	CodeTabletSnapshotExpired                  ErrorCode = 1708
	CodeQueryInputRowCountLimitExceeded        ErrorCode = 1709
	CodeQueryOutputRowCountLimitExceeded       ErrorCode = 1710
	CodeQueryExpressionDepthLimitExceeded      ErrorCode = 1711
	CodeRowIsBlocked                           ErrorCode = 1712
	CodeBlockedRowWaitTimeout                  ErrorCode = 1713
	CodeNoSyncReplicas                         ErrorCode = 1714
	CodeTableMustNotBeReplicated               ErrorCode = 1715
	CodeTableMustBeSorted                      ErrorCode = 1716
	CodeTooManyRowsInTransaction               ErrorCode = 1717
	CodeUpstreamReplicaMismatch                ErrorCode = 1718
	CodeNoSuchDynamicStore                     ErrorCode = 1719
	CodeShellExited                            ErrorCode = 1800
	CodeShellManagerShutDown                   ErrorCode = 1801
	CodeTooManyConcurrentRequests              ErrorCode = 1900
	CodeJobArchiveUnavailable                  ErrorCode = 1910
	CodeRetriableArchiveError                  ErrorCode = 1911
	CodeAPINoSuchOperation                     ErrorCode = 1915
	CodeAPINoSuchJob                           ErrorCode = 1916
	CodeNoSuchAttribute                        ErrorCode = 1920
	CodeDataSliceLimitExceeded                 ErrorCode = 2000
	CodeMaxDataWeightPerJobExceeded            ErrorCode = 2001
	CodeMaxPrimaryDataWeightPerJobExceeded     ErrorCode = 2002
	CodeProxyBanned                            ErrorCode = 2100
	CodeSubqueryDataWeightLimitExceeded        ErrorCode = 2200
	CodeParticipantUnregistered                ErrorCode = 2201
	CodeNoSuchGroup                            ErrorCode = 2300
	CodeNoSuchMember                           ErrorCode = 2301
	CodeNoSuchThrottler                        ErrorCode = 2400
	CodeUnexpectedThrottlerMode                ErrorCode = 2401
	CodeUnrecognizedConfigOption               ErrorCode = 2500
	CodeFailedToFetchDynamicConfig             ErrorCode = 2501
	CodeDuplicateMatchingDynamicConfigs        ErrorCode = 2502
	CodeUnrecognizedDynamicConfigOption        ErrorCode = 2503
	CodeFailedToApplyDynamicConfig             ErrorCode = 2504
	CodeInvalidDynamicConfig                   ErrorCode = 2505
	CodeAgentCallFailed                        ErrorCode = 4400
	CodeNoOnlineNodeToScheduleJob              ErrorCode = 4410
	CodeMaterializationFailed                  ErrorCode = 4415
	CodeNoSuchTransaction                      ErrorCode = 11000
	CodeNestedExternalTransactionExists        ErrorCode = 11001
	CodeTransactionDepthLimitReached           ErrorCode = 11002
	CodeInvalidTransactionState                ErrorCode = 11003
	CodeParticipantFailedToPrepare             ErrorCode = 11004
	CodeSomeParticipantsAreDown                ErrorCode = 11005
	CodeAlienTransactionsForbidden             ErrorCode = 11006
	CodeMalformedAlienTransaction              ErrorCode = 11007
	CodeInvalidTransactionAtomicity            ErrorCode = 11008
	CodeUploadTransactionCannotHaveNested      ErrorCode = 11009
	CodeForeignParentTransaction               ErrorCode = 11010
	CodeForeignPrerequisiteTransaction         ErrorCode = 11011
	CodeFailedToStartContainer                 ErrorCode = 14000
	CodeJobIsNotRunning                        ErrorCode = 17000
)

func (ErrorCode) String

func (e ErrorCode) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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