Documentation
¶
Index ¶
- Variables
- func IsErrorType(err error, errType ErrorType) bool
- type Error
- func E(op Op, err error, errType ErrorType, message string) *Error
- func NewAlreadyExistsError(op Op, err error, message string) *Error
- func NewAuthorizationError(op Op, err error, message string) *Error
- func NewConflictError(op Op, err error, message string) *Error
- func NewForbiddenError(op Op, err error, message string) *Error
- func NewIncorrectInputError(op Op, err error, message string) *Error
- func NewNotFound(op Op, err error, message string) *Error
- func NewUnknownError(op Op, err error, message string) *Error
- func WithOp(op Op, err error, msg string) *Error
- func (e *Error) Error() string
- func (e *Error) HasOperation(op Op) bool
- func (e *Error) Is(target error) bool
- func (e *Error) Log(logger *slog.Logger)
- func (e *Error) Message() map[string]string
- func (e *Error) Operations() []OpMessage
- func (e *Error) Type() ErrorType
- func (e *Error) Unwrap() error
- func (e *Error) WithContext(key string, value any) *Error
- func (e *Error) WithMessages(messages []Message) *Error
- type ErrorType
- type Message
- type Op
- type OpMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorTypeForbidden = ErrorType{"forbidden"} ErrorTypeAuthorization = ErrorType{"authorization"} ErrorTypeIncorrectInput = ErrorType{"incorrect-input"} ErrorTypeNotFound = ErrorType{"not-found"} ErrorTypeConflict = ErrorType{"conflict"} ErrorTypeAlreadyExists = ErrorType{"already-exists"} )
is Error type exposed to client
View Source
var ErrInvalidInput = errors.New("invalid input")
View Source
var (
ErrorTypeUnknown = ErrorType{"unknown"}
)
Error types not exposed to client
Functions ¶
func IsErrorType ¶
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (*Error) HasOperation ¶
func (*Error) Operations ¶
func (*Error) WithMessages ¶
Click to show internal directories.
Click to hide internal directories.