Documentation ¶
Overview ¶
Package weberrors aims to ease error reporting for webish service programming. The error type here implements the github.com/HailoOSS/platform/errors Errors interface If in doubt, ask author (John Dobronszki)
Index ¶
- Constants
- type Error
- func (e *Error) AddContext(s ...string) errors.Error
- func (e *Error) Code() string
- func (e *Error) Context() []string
- func (e *Error) Description() string
- func (e *Error) Error() string
- func (e *Error) HasErrors() bool
- func (e *Error) HttpCode() uint32
- func (e *Error) MultiStack() *stack.Multi
- func (e *Error) SetC(k, v string) *Error
- func (e *Error) SetCode(c string) *Error
- func (e *Error) SetD(s string) *Error
- func (e *Error) Type() string
- func (e *Error) UnsetC(k string) *Error
Constants ¶
const ( BadRequest = "BAD_REQUEST" InternalServerError = "INTERNAL_SERVER_ERROR" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error implements the errors.Error() interface.
func New ¶
func New() *Error
New returns a new *Error, without containing any errors (ie. .HasErrors() returns false on a newly created one).
func (*Error) Description ¶
Description returns a web-friendly description or the actual description from the struct
func (*Error) HttpCode ¶
HttpCode returns either 400 if it is a client bad request or 500 if it is a server error This will probably be improvde in the future
func (*Error) MultiStack ¶
func (*Error) SetCode ¶
SetCode sets the error code. (eg. com.HailoOSS.service.organization.whatever)