Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorStack ¶
ErrorStack returns the full stack of information attached to this error.
Types ¶
type ConcreteUserError ¶
type ConcreteUserError struct {
ErrCause error `json:"-"`
ErrStatus int `json:"-"`
ErrCode string `json:"code"`
ErrMessage string `json:"message"`
}
ConcreteUserError is a concrete type that implements the UserError interface.
func Build ¶
func Build(err UserError) *ConcreteUserError
Build constructs a ConcreteUserError from a UserError.
func (*ConcreteUserError) Cause ¶
func (e *ConcreteUserError) Cause() error
Cause complies to the UserError interface.
func (*ConcreteUserError) Code ¶
func (e *ConcreteUserError) Code() string
Code complies to the UserError interface.
func (*ConcreteUserError) Error ¶
func (e *ConcreteUserError) Error() string
Error complies to the UserError and error interface.
func (*ConcreteUserError) Message ¶
func (e *ConcreteUserError) Message() string
Message complies to the UserError interface.
func (*ConcreteUserError) Status ¶
func (e *ConcreteUserError) Status() int
Status complies to the UserError interface.
type UserError ¶
type UserError interface {
Cause() error
Status() int
Code() string
Message() string
Error() string
}
UserError is the error interface that can be returned by the API
func ExtractUserError ¶
ExtractUserError returns the underlying UserError or nil otherwise
func NewUserError ¶
NewUserError is an helper function to construct a new UserError.
Click to show internal directories.
Click to hide internal directories.