Documentation
¶
Index ¶
- Variables
- type CustomError
- func (*CustomError) Descriptor() ([]byte, []int)deprecated
- func (x *CustomError) GetCode() CustomError_CustomErrorCode
- func (x *CustomError) GetEntity() string
- func (x *CustomError) GetErrorMessage() string
- func (*CustomError) ProtoMessage()
- func (x *CustomError) ProtoReflect() protoreflect.Message
- func (x *CustomError) Reset()
- func (x *CustomError) String() string
- type CustomError_CustomErrorCode
- func (CustomError_CustomErrorCode) Descriptor() protoreflect.EnumDescriptor
- func (x CustomError_CustomErrorCode) Enum() *CustomError_CustomErrorCode
- func (CustomError_CustomErrorCode) EnumDescriptor() ([]byte, []int)deprecated
- func (x CustomError_CustomErrorCode) Number() protoreflect.EnumNumber
- func (x CustomError_CustomErrorCode) String() string
- func (CustomError_CustomErrorCode) Type() protoreflect.EnumType
- type Error
- type Error_Status
- func (*Error_Status) Descriptor() ([]byte, []int)deprecated
- func (x *Error_Status) GetCode() int32
- func (x *Error_Status) GetDetails() []*anypb.Any
- func (x *Error_Status) GetMessage() string
- func (x *Error_Status) GetStatus() code.Code
- func (*Error_Status) ProtoMessage()
- func (x *Error_Status) ProtoReflect() protoreflect.Message
- func (x *Error_Status) Reset()
- func (x *Error_Status) String() string
Constants ¶
This section is empty.
Variables ¶
var ( CustomError_CustomErrorCode_name = map[int32]string{ 0: "CUSTOM_ERROR_CODE_UNSPECIFIED", 1: "TOO_MANY_FOO", 2: "NOT_ENOUGH_FOO", 3: "UNIVERSE_WAS_DESTROYED", } CustomError_CustomErrorCode_value = map[string]int32{ "CUSTOM_ERROR_CODE_UNSPECIFIED": 0, "TOO_MANY_FOO": 1, "NOT_ENOUGH_FOO": 2, "UNIVERSE_WAS_DESTROYED": 3, } )
Enum value maps for CustomError_CustomErrorCode.
var File_apierror_internal_proto_error_proto protoreflect.FileDescriptor
var File_custom_error_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type CustomError ¶ added in v2.5.1
type CustomError struct { // Error code specific to the custom API being invoked. Code CustomError_CustomErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=error.CustomError_CustomErrorCode" json:"code,omitempty"` // Name of the failed entity. Entity string `protobuf:"bytes,2,opt,name=entity,proto3" json:"entity,omitempty"` // Message that describes the error. ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` // contains filtered or unexported fields }
CustomError is an example of a custom error message which may be included in an rpc status. It is not meant to reflect a standard error.
func (*CustomError) Descriptor
deprecated
added in
v2.5.1
func (*CustomError) Descriptor() ([]byte, []int)
Deprecated: Use CustomError.ProtoReflect.Descriptor instead.
func (*CustomError) GetCode ¶ added in v2.5.1
func (x *CustomError) GetCode() CustomError_CustomErrorCode
func (*CustomError) GetEntity ¶ added in v2.5.1
func (x *CustomError) GetEntity() string
func (*CustomError) GetErrorMessage ¶ added in v2.5.1
func (x *CustomError) GetErrorMessage() string
func (*CustomError) ProtoMessage ¶ added in v2.5.1
func (*CustomError) ProtoMessage()
func (*CustomError) ProtoReflect ¶ added in v2.5.1
func (x *CustomError) ProtoReflect() protoreflect.Message
func (*CustomError) Reset ¶ added in v2.5.1
func (x *CustomError) Reset()
func (*CustomError) String ¶ added in v2.5.1
func (x *CustomError) String() string
type CustomError_CustomErrorCode ¶ added in v2.5.1
type CustomError_CustomErrorCode int32
Error code for `CustomError`.
const ( // Default error. CustomError_CUSTOM_ERROR_CODE_UNSPECIFIED CustomError_CustomErrorCode = 0 // Too many foo. CustomError_TOO_MANY_FOO CustomError_CustomErrorCode = 1 // Not enough foo. CustomError_NOT_ENOUGH_FOO CustomError_CustomErrorCode = 2 // Catastrophic error. CustomError_UNIVERSE_WAS_DESTROYED CustomError_CustomErrorCode = 3 )
func (CustomError_CustomErrorCode) Descriptor ¶ added in v2.5.1
func (CustomError_CustomErrorCode) Descriptor() protoreflect.EnumDescriptor
func (CustomError_CustomErrorCode) Enum ¶ added in v2.5.1
func (x CustomError_CustomErrorCode) Enum() *CustomError_CustomErrorCode
func (CustomError_CustomErrorCode) EnumDescriptor
deprecated
added in
v2.5.1
func (CustomError_CustomErrorCode) EnumDescriptor() ([]byte, []int)
Deprecated: Use CustomError_CustomErrorCode.Descriptor instead.
func (CustomError_CustomErrorCode) Number ¶ added in v2.5.1
func (x CustomError_CustomErrorCode) Number() protoreflect.EnumNumber
func (CustomError_CustomErrorCode) String ¶ added in v2.5.1
func (x CustomError_CustomErrorCode) String() string
func (CustomError_CustomErrorCode) Type ¶ added in v2.5.1
func (CustomError_CustomErrorCode) Type() protoreflect.EnumType
type Error ¶
type Error struct { // The actual error payload. The nested message structure is for backward // compatibility with Google API client libraries. It also makes the error // more readable to developers. Error *Error_Status `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
The error format v2 for Google JSON REST APIs. Copied from https://cloud.google.com/apis/design/errors#http_mapping.
NOTE: This schema is not used for other wire protocols.
func (*Error) Descriptor
deprecated
func (*Error) GetError ¶
func (x *Error) GetError() *Error_Status
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type Error_Status ¶
type Error_Status struct { // The HTTP status code that corresponds to `google.rpc.Status.code`. Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // This corresponds to `google.rpc.Status.message`. Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // This is the enum version for `google.rpc.Status.code`. Status code.Code `protobuf:"varint,4,opt,name=status,proto3,enum=google.rpc.Code" json:"status,omitempty"` // This corresponds to `google.rpc.Status.details`. Details []*anypb.Any `protobuf:"bytes,5,rep,name=details,proto3" json:"details,omitempty"` // contains filtered or unexported fields }
This message has the same semantics as `google.rpc.Status`. It uses HTTP status code instead of gRPC status code. It has an extra field `status` for backward compatibility with Google API Client Libraries.
func (*Error_Status) Descriptor
deprecated
func (*Error_Status) Descriptor() ([]byte, []int)
Deprecated: Use Error_Status.ProtoReflect.Descriptor instead.
func (*Error_Status) GetCode ¶
func (x *Error_Status) GetCode() int32
func (*Error_Status) GetDetails ¶
func (x *Error_Status) GetDetails() []*anypb.Any
func (*Error_Status) GetMessage ¶
func (x *Error_Status) GetMessage() string
func (*Error_Status) GetStatus ¶
func (x *Error_Status) GetStatus() code.Code
func (*Error_Status) ProtoMessage ¶
func (*Error_Status) ProtoMessage()
func (*Error_Status) ProtoReflect ¶
func (x *Error_Status) ProtoReflect() protoreflect.Message
func (*Error_Status) Reset ¶
func (x *Error_Status) Reset()
func (*Error_Status) String ¶
func (x *Error_Status) String() string