errdetails

package
v0.0.0-...-4125756 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use ErrorInfo.ProtoReflect.Descriptor instead.

func (*ErrorInfo) GetMetadata

func (x *ErrorInfo) GetMetadata() map[string]string

func (*ErrorInfo) GetReason

func (x *ErrorInfo) GetReason() string

func (*ErrorInfo) ProtoMessage

func (*ErrorInfo) ProtoMessage()

func (*ErrorInfo) ProtoReflect

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

func (*ErrorInfo) Reset

func (x *ErrorInfo) Reset()

func (*ErrorInfo) String

func (x *ErrorInfo) String() string

func (*ErrorInfo) Validate

func (m *ErrorInfo) Validate() error

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

func (m *ErrorInfo) ValidateAll() error

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

Key function returns key value.

func (ErrorInfoValidationError) Reason

func (e ErrorInfoValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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