Documentation ¶
Index ¶
- Constants
- 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 NewNotImplementedError(message string) 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 ¶
View Source
const ( // The Invalid type should not be used, only useful to assert whether or not an error is an MdmError during cast ErrorTypeUnspecified = ErrorType("") ErrorTypeInternal = ErrorType("INTERNAL") ErrorTypeOutOfRange = ErrorType("OUT_OF_RANGE") ErrorTypeUnsupported = ErrorType("UNSUPPORTED") // Bad request ErrorTypeNotFound = ErrorType("NOT_FOUND") ErrorTypeAlreadyExists = ErrorType("ALREADY_EXISTS") // Conflict // Map to 422 ErrorTypeInvalidFormat = ErrorType("INVALID_FORMAT") // Map to 400 ErrorTypeFailedPrecondition = ErrorType("FAILED_PRECONDITION") ErrorTypeNotImplemented = ErrorType("NOT_IMPLEMENTED") )
Variables ¶
This section is empty.
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 NewNotImplementedError ¶ added in v0.0.22
func NewNotImplementedError(message string) 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
Click to show internal directories.
Click to hide internal directories.