Documentation
¶
Index ¶
- func As(err error, target interface{}) bool
- func Is(err, target error) bool
- func New(message string) error
- func Unwrap(err error) error
- func Wrap(parent, err error) error
- type Error
- func (e *Error) As(target interface{}) bool
- func (e *Error) Error() string
- func (e *Error) GetTrace() string
- func (e *Error) Is(err error) bool
- func (e *Error) Unwrap() error
- func (e *Error) Value() *Error
- func (e *Error) WithDetails(details interface{}) *Error
- func (e *Error) WithMessage(message string) *Error
- func (e *Error) WithStatusCode(statusCode int) *Error
- func (e *Error) Wrap(err error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error struct { StatusCode int `json:"-"` Code string `json:"code"` Message string `json:"message"` Details interface{} `json:"details,omitempty"` // contains filtered or unexported fields }
Error is the type which can be used as an implementation of error
func (*Error) WithDetails ¶
WithDetails is used to attach the details to the error response
func (*Error) WithMessage ¶
WithMessage is used to create a new error with the message changed
func (*Error) WithStatusCode ¶
WithStatusCode is used to create a new error with the status code changed
Click to show internal directories.
Click to hide internal directories.