Documentation ¶
Index ¶
- Variables
- func IsFailedPreconditionError(e error) bool
- func IsNotFoundError(e error) bool
- type CliniaError
- func IsCliniaError(e error) (*CliniaError, bool)
- func NewAlreadyExistsError(message string) CliniaError
- func NewCliniaErrorFromMessage(msg string) (*CliniaError, error)
- func NewEnumOutOfRangeError(actual string, expectedOneOf []string, enumName string) CliniaError
- func NewFailedPreconditionError(message string) CliniaError
- func NewInvalidFormatError(message string) CliniaError
- func NewMultipleOutOfRangeError(actual []string, expectedOneOf []string) CliniaError
- func NewNotFoundError(msg string, err error) CliniaError
- func NewSingleOutOfRangeError(actual string, expectedOneOf []string) CliniaError
- func NewUnsupportedError(message string) CliniaError
- func NewUnsupportedTypeError[T1 any, T2 any](actual T1, expected T2) CliniaError
- func NewUnsupportedValueError(actual string, expected string) CliniaError
- type CliniaRetryableError
- type ErrorType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorType_name = map[int]string{ 0: "UNSPECIFIED", 1: "INTERNAL", 2: "OUT_OF_RANGE", 3: "UNSUPPORTED", 4: "NOT_FOUND", 5: "ALREADY_EXISTS", 6: "INVALID_FORMAT", 7: "FAILED_PRECONDITION", } ErrorType_value = map[string]int{ "UNSPECIFIED": 0, "INTERNAL": 1, "OUT_OF_RANGE": 2, "UNSUPPORTED": 3, "NOT_FOUND": 4, "ALREADY_EXISTS": 5, "INVALID_FORMAT": 6, "FAILED_PRECONDITION": 7, } )
TODO: update below
Functions ¶
func IsNotFoundError ¶
Types ¶
type CliniaError ¶
type CliniaError struct { Type ErrorType `json:"type"` Message string `json:"message"` OriginalError error // Not returned to clients }
func IsCliniaError ¶
func IsCliniaError(e error) (*CliniaError, bool)
func NewAlreadyExistsError ¶
func NewAlreadyExistsError(message string) CliniaError
func NewCliniaErrorFromMessage ¶
func NewCliniaErrorFromMessage(msg string) (*CliniaError, error)
func NewEnumOutOfRangeError ¶
func NewEnumOutOfRangeError(actual string, expectedOneOf []string, enumName string) CliniaError
func NewFailedPreconditionError ¶
func NewFailedPreconditionError(message string) CliniaError
func NewInvalidFormatError ¶
func NewInvalidFormatError(message string) CliniaError
func NewMultipleOutOfRangeError ¶
func NewMultipleOutOfRangeError(actual []string, expectedOneOf []string) CliniaError
func NewNotFoundError ¶
func NewNotFoundError(msg string, err error) CliniaError
func NewSingleOutOfRangeError ¶
func NewSingleOutOfRangeError(actual string, expectedOneOf []string) CliniaError
func NewUnsupportedError ¶
func NewUnsupportedError(message string) CliniaError
func NewUnsupportedTypeError ¶
func NewUnsupportedTypeError[T1 any, T2 any](actual T1, expected T2) CliniaError
func NewUnsupportedValueError ¶
func NewUnsupportedValueError(actual string, expected string) CliniaError
func (CliniaError) Error ¶
func (e CliniaError) Error() string
type CliniaRetryableError ¶
type CliniaRetryableError = CliniaError
func NewInternalError ¶
func NewInternalError(e error) CliniaRetryableError
type ErrorType ¶
type ErrorType int
const ( // The Invalid type should not be used, only useful to assert whether or not an error is an MdmError during cast ErrorTypeUnspecified ErrorType = iota ErrorTypeInternal ErrorTypeOutOfRange ErrorTypeUnsupported // Bad request ErrorTypeNotFound ErrorTypeAlreadyExists // Conflict // Map to 422 ErrorTypeInvalidFormat // Map to 400 ErrorTypeFailedPrecondition )
func ParseErrorType ¶
func (ErrorType) MarshalJSON ¶
func (*ErrorType) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.