Documentation ¶
Overview ¶
Package errors provides an interface for all errors returned from Tharsis.
Index ¶
Constants ¶
View Source
const ( EInternal = "internal error" ENotImplemented = "not implemented" ENotFound = "not found" EConflict = "conflict" EOptimisticLock = "optimistic lock" EInvalid = "invalid" EForbidden = "forbidden" ETooManyRequests = "too many requests" ETooLarge = "request too large" )
Error code constants
Variables ¶
This section is empty.
Functions ¶
func ErrorCode ¶
ErrorCode returns the code of the root error, if available; otherwise returns EINTERNAL.
func ErrorMessage ¶
ErrorMessage returns the messages associated with the error
Types ¶
type TharsisError ¶
type TharsisError struct {
// contains filtered or unexported fields
}
TharsisError is the internal error implementation for the Tharsis API
func New ¶
func New(code string, format string, a ...any) *TharsisError
New returns a new Tharsis error with the code and message fields set
func Wrap ¶
func Wrap(err error, code string, format string, a ...any) *TharsisError
Wrap returns a new TharsisError which wraps an existing error
func (*TharsisError) Error ¶
func (e *TharsisError) Error() string
Error implements the error interface by writing out the recursive messages.
Click to show internal directories.
Click to hide internal directories.