errors

package
v0.7.22 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_errors_proto protoreflect.FileDescriptor

Functions

func Equal added in v0.6.1

func Equal(err1 error, err2 error) bool

Types

type Error

type Error struct {
	Code    int32        `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`                     // http status code
	Status  string       `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`                  // http status text
	Name    string       `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`                      // error name
	Message string       `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`                // error message
	Details []*anypb.Any `protobuf:"bytes,5,rep,name=details,proto3" json:"details,omitempty"`                // error details
	DebugId string       `protobuf:"bytes,6,opt,name=debug_id,json=debugId,proto3" json:"debug_id,omitempty"` // request debug id
	// contains filtered or unexported fields
}

func FromError

func FromError(err error) *Error

func Parse

func Parse(err string) *Error

func (*Error) Descriptor deprecated

func (*Error) Descriptor() ([]byte, []int)

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) Error

func (e *Error) Error() string

func (*Error) GetCode

func (x *Error) GetCode() int32

func (*Error) GetDebugId added in v0.7.12

func (x *Error) GetDebugId() string

func (*Error) GetDetails added in v0.7.12

func (x *Error) GetDetails() []*anypb.Any

func (*Error) GetMessage added in v0.7.12

func (x *Error) GetMessage() string

func (*Error) GetName

func (x *Error) GetName() string

func (*Error) GetStatus

func (x *Error) GetStatus() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

func (x *Error) ProtoReflect() protoreflect.Message

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

func (*Error) Validate added in v0.7.12

func (m *Error) Validate() error

Validate checks the field values on Error with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Error) ValidateAll added in v0.7.12

func (m *Error) ValidateAll() error

ValidateAll checks the field values on Error with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ErrorMultiError, or nil if none found.

func (*Error) WithMessageValues added in v0.7.12

func (e *Error) WithMessageValues(values any) *Error

type ErrorMultiError added in v0.7.12

type ErrorMultiError []error

ErrorMultiError is an error wrapping multiple validation errors returned by Error.ValidateAll() if the designated constraints aren't met.

func (ErrorMultiError) AllErrors added in v0.7.12

func (m ErrorMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ErrorMultiError) Error added in v0.7.12

func (m ErrorMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ErrorValidationError added in v0.7.12

type ErrorValidationError struct {
	// contains filtered or unexported fields
}

ErrorValidationError is the validation error returned by Error.Validate if the designated constraints aren't met.

func (ErrorValidationError) Cause added in v0.7.12

func (e ErrorValidationError) Cause() error

Cause function returns cause value.

func (ErrorValidationError) Error added in v0.7.12

func (e ErrorValidationError) Error() string

Error satisfies the builtin error interface

func (ErrorValidationError) ErrorName added in v0.7.12

func (e ErrorValidationError) ErrorName() string

ErrorName returns error name.

func (ErrorValidationError) Field added in v0.7.12

func (e ErrorValidationError) Field() string

Field function returns field value.

func (ErrorValidationError) Key added in v0.7.12

func (e ErrorValidationError) Key() bool

Key function returns key value.

func (ErrorValidationError) Reason added in v0.7.12

func (e ErrorValidationError) Reason() string

Reason function returns reason value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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