Documentation
¶
Index ¶
- Variables
- type ErrorInfo
- func (*ErrorInfo) Descriptor() ([]byte, []int)deprecated
- func (x *ErrorInfo) GetMetadata() map[string]string
- func (x *ErrorInfo) GetReason() string
- func (*ErrorInfo) ProtoMessage()
- func (x *ErrorInfo) ProtoReflect() protoreflect.Message
- func (x *ErrorInfo) Reset()
- func (x *ErrorInfo) String() string
- func (m *ErrorInfo) Validate() error
- func (m *ErrorInfo) ValidateAll() error
- type ErrorInfoMultiError
- type ErrorInfoValidationError
Constants ¶
This section is empty.
Variables ¶
var File_errdetails_error_details_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type ErrorInfo ¶
type ErrorInfo struct { // The reason of the error. This is a constant value that identifies the // proximate cause of the error. Error reasons are unique within a particular // domain of errors. This should be at most 63 characters and match Reason string `protobuf:"bytes,1,opt,name=reason,proto3" json:"reason,omitempty"` // Additional structured details about this error. Metadata map[string]string `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
Describes the cause of the error with structured details.
Example of an error when contacting the "organization" API when it fail adding members to an organization:
{ "reason": "ALREADY_EXIST" "metadata": { "user_id": "1234", "org_id": "2345" } }
This response indicates that the member is already part of the organization.
func (*ErrorInfo) Descriptor
deprecated
func (*ErrorInfo) GetMetadata ¶
func (*ErrorInfo) ProtoMessage ¶
func (*ErrorInfo) ProtoMessage()
func (*ErrorInfo) ProtoReflect ¶
func (x *ErrorInfo) ProtoReflect() protoreflect.Message
func (*ErrorInfo) Validate ¶
Validate checks the field values on ErrorInfo 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 (*ErrorInfo) ValidateAll ¶
ValidateAll checks the field values on ErrorInfo 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 ErrorInfoMultiError, or nil if none found.
type ErrorInfoMultiError ¶
type ErrorInfoMultiError []error
ErrorInfoMultiError is an error wrapping multiple validation errors returned by ErrorInfo.ValidateAll() if the designated constraints aren't met.
func (ErrorInfoMultiError) AllErrors ¶
func (m ErrorInfoMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ErrorInfoMultiError) Error ¶
func (m ErrorInfoMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ErrorInfoValidationError ¶
type ErrorInfoValidationError struct {
// contains filtered or unexported fields
}
ErrorInfoValidationError is the validation error returned by ErrorInfo.Validate if the designated constraints aren't met.
func (ErrorInfoValidationError) Cause ¶
func (e ErrorInfoValidationError) Cause() error
Cause function returns cause value.
func (ErrorInfoValidationError) Error ¶
func (e ErrorInfoValidationError) Error() string
Error satisfies the builtin error interface
func (ErrorInfoValidationError) ErrorName ¶
func (e ErrorInfoValidationError) ErrorName() string
ErrorName returns error name.
func (ErrorInfoValidationError) Field ¶
func (e ErrorInfoValidationError) Field() string
Field function returns field value.
func (ErrorInfoValidationError) Key ¶
func (e ErrorInfoValidationError) Key() bool
Key function returns key value.
func (ErrorInfoValidationError) Reason ¶
func (e ErrorInfoValidationError) Reason() string
Reason function returns reason value.