Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNil = newBusinessError(0, "ok") ErrValidation = newBusinessError(1, "Invalid parameter") ErrInternalServer = newBusinessError(2, "Internal server error") )
General errors
View Source
var LocalFileRepo string = "."
Functions ¶
func MustServeLocal ¶
Types ¶
type BusinessError ¶
type BusinessError struct { Code int `json:"code"` Message string `json:"message"` Data interface{} `json:"data"` }
func NewBusinessError ¶
func NewBusinessError(code int, message string, data interface{}) *BusinessError
func (*BusinessError) Error ¶
func (err *BusinessError) Error() string
func (*BusinessError) WithData ¶
func (be *BusinessError) WithData(data interface{}) *BusinessError
Click to show internal directories.
Click to hide internal directories.