Documentation ¶
Index ¶
- Constants
- func IsAlreadyExistsError(e error) bool
- func IsFailedPreconditionError(e error) bool
- func IsInternalError(e error) bool
- func IsInvalidFormatError(e error) bool
- func IsNotFoundError(e error) bool
- func IsUnsupportedError(e error) bool
- type CliniaError
- func AlreadyExistsErrorf(format string, args ...interface{}) CliniaError
- func FailedPreconditionErrorf(format string, args ...interface{}) CliniaError
- func InternalErrorf(format string, args ...interface{}) CliniaError
- func InvalidFormatErrorf(format string, args ...interface{}) CliniaError
- func IsCliniaError(e error) (*CliniaError, bool)
- func NewAlreadyExistsError(message string) CliniaErrordeprecated
- func NewCliniaErrorFromMessage(msg string) (*CliniaError, error)
- func NewEnumOutOfRangeError(actual string, expectedOneOf []string, enumName string) CliniaError
- func NewFailedPreconditionError(message string) CliniaErrordeprecated
- func NewInvalidFormatError(message string) CliniaErrordeprecated
- func NewMultipleOutOfRangeError(actual []string, expectedOneOf []string) CliniaError
- func NewNotFoundError(msg string, err error) CliniaErrordeprecated
- func NewNotImplementedError(message string) CliniaErrordeprecated
- func NewSingleOutOfRangeError(actual string, expectedOneOf []string) CliniaError
- func NewUnsupportedError(message string) CliniaErrordeprecated
- func NewUnsupportedTypeError[T1 any, T2 any](actual T1, expected T2) CliniaError
- func NewUnsupportedValueError(actual string, expected string) CliniaError
- func NotFoundErrorf(format string, args ...interface{}) CliniaError
- func UnsupportedErrorf(format string, args ...interface{}) CliniaError
- type CliniaRetryableError
- type ErrorType
Constants ¶
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 IsAlreadyExistsError ¶ added in v0.0.25
func IsInternalError ¶ added in v0.0.25
func IsInvalidFormatError ¶ added in v0.0.25
func IsNotFoundError ¶
func IsUnsupportedError ¶ added in v0.0.25
Types ¶
type CliniaError ¶
type CliniaError struct { Type ErrorType `json:"type"` Message string `json:"message"` OriginalError error // Not returned to clients }
func AlreadyExistsErrorf ¶ added in v0.0.25
func AlreadyExistsErrorf(format string, args ...interface{}) CliniaError
AlreadyExistsErrorf creates a CliniaError with type ErrorTypeAlreadyExists and a formatted message
func FailedPreconditionErrorf ¶ added in v0.0.25
func FailedPreconditionErrorf(format string, args ...interface{}) CliniaError
FailedPreconditionErrorf creates a CliniaError with type ErrorTypeFailedPrecondition and a formatted message
func InternalErrorf ¶ added in v0.0.25
func InternalErrorf(format string, args ...interface{}) CliniaError
InternalErrorf creates a CliniaError with type ErrorTypeInternal and a formatted message
func InvalidFormatErrorf ¶ added in v0.0.25
func InvalidFormatErrorf(format string, args ...interface{}) CliniaError
InvalidFormatErrorf creates a CliniaError with type ErrorTypeInvalidFormat and a formatted message
func IsCliniaError ¶
func IsCliniaError(e error) (*CliniaError, bool)
func NewAlreadyExistsError
deprecated
func NewAlreadyExistsError(message string) CliniaError
Deprecated: use AlreadyExistsErrorf instead
func NewCliniaErrorFromMessage ¶
func NewCliniaErrorFromMessage(msg string) (*CliniaError, error)
func NewEnumOutOfRangeError ¶
func NewEnumOutOfRangeError(actual string, expectedOneOf []string, enumName string) CliniaError
func NewFailedPreconditionError
deprecated
func NewFailedPreconditionError(message string) CliniaError
Deprecated: use FailedPreconditionErrorf instead
func NewInvalidFormatError
deprecated
func NewInvalidFormatError(message string) CliniaError
Deprecated: use UnsupportedErrorf instead
func NewMultipleOutOfRangeError ¶
func NewMultipleOutOfRangeError(actual []string, expectedOneOf []string) CliniaError
func NewNotFoundError
deprecated
func NewNotFoundError(msg string, err error) CliniaError
Deprecated: use NotFoundErrorf instead
func NewNotImplementedError
deprecated
added in
v0.0.22
func NewNotImplementedError(message string) CliniaError
Deprecated: use InternalErrorf instead
func NewSingleOutOfRangeError ¶
func NewSingleOutOfRangeError(actual string, expectedOneOf []string) CliniaError
func NewUnsupportedError
deprecated
func NewUnsupportedError(message string) CliniaError
Deprecated: use UnsupportedErrorf instead
func NewUnsupportedTypeError ¶
func NewUnsupportedTypeError[T1 any, T2 any](actual T1, expected T2) CliniaError
func NewUnsupportedValueError ¶
func NewUnsupportedValueError(actual string, expected string) CliniaError
func NotFoundErrorf ¶ added in v0.0.25
func NotFoundErrorf(format string, args ...interface{}) CliniaError
NotFoundErrorf creates a CliniaError with type ErrorTypeNotFound and a formatted message
func UnsupportedErrorf ¶ added in v0.0.25
func UnsupportedErrorf(format string, args ...interface{}) CliniaError
UnsupportedErrorf creates a CliniaError with type ErrorTypeUnsupported and a formatted message
func (CliniaError) Error ¶
func (e CliniaError) Error() string
type CliniaRetryableError ¶
type CliniaRetryableError = CliniaError
func NewInternalError
deprecated
func NewInternalError(e error) CliniaRetryableError
Deprecated: use InternalErrorf instead