Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoEntry = errors.New("storage: no entry") ErrCorruptStorage = errors.New("storage: corrupt") )
TODO (jun, pharrell): ErrAlreadyExists, ErrExist, ErrVMSStorageNode... - Use basic error? (ErrAlreadyExists, ErrExist, ...) - Use specific error? (ErrLogStreamAlreadyExists, ...)
var ( ErrTrimmed = errors.New("logstream: trimmed") ErrUndecidable = errors.New("logstream: undecidable") ErrCorruptLogStream = errors.New("logstream: corrupt") ErrSealed = errors.New("sealed") ErrUnordered = errors.New("logstream: unordered scanner") )
var ( ErrInvalid = errors.New("invalid argument") ErrExist = errors.New("already exists") ErrNotExist = errors.New("not exist") ErrState = errors.New("invalid state") ErrClosed = errors.New("closed") ErrIgnore = errors.New("ignore") ErrInprogress = errors.New("inprogress") ErrNeedRetry = errors.New("need retry") ErrStopped = errors.New("stopped") ErrNotMember = errors.New("not member") ErrNotEmpty = errors.New("not empty") ErrInvalidArgument = errors.New("status - invalid argument") ErrAlreadyExists = errors.New("status - varlogserver: already exists") ErrInternal = errors.New("status - internal error") )
Functions ¶
func FromStatusError ¶
FromStatusError converts an grpc/status.statusError into an error. There are below cases: - If maybeStatusErr is nil, it returns nil. - If maybeStatusErr is not type of grpc/status.statusError, it returns maybeStatusErr again. - In case of that maybeStatusErr is type of grpc/status.statusError:
- try to parse Details field, and return an error if it is parsed
- if the error is not parsed, and its code is either grpc/codes.DeadlineExceeded or grpc/codes.Canceled, FromStatusError returns context error
- if the code is code.Unavailable, then wrap the error by transientError and return it
func ToStatusError ¶
ToStatusError converts an errors into grpc/status.statusError. It usually is used before sending responses via gRPC. If the err is either context.DeadlineExceeded or context.Canceled, it returns grpc/status.statusError having a code of either codes.DeadlineExceeded or codes.Canceled.
Types ¶
This section is empty.