Documentation
¶
Index ¶
- Constants
- func BadRequest(msg string) error
- func Code(errorCode string) error
- func CodeMsg(errorCode, msg string) error
- func Conflict(msg string) error
- func Error(errorString ErrorString) error
- func ForbiddenError(msg string) error
- func InternalServerError(msg string) error
- func MethodNotAllowed(msg string) error
- func NotFound(msg string) error
- func UnauthorizedError(msg string) error
- type ErrorCode
- type ErrorString
Constants ¶
View Source
const ( FileNameErrorCodeCollection = "./configs/resources/error-codes.json" DefaultErrorCode = "CORE-999" )
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
BadRequest will throw if the given request-body or params is not valid
func Error ¶
func Error(errorString ErrorString) error
func ForbiddenError ¶
func InternalServerError ¶
InternalServerError will throw if any the Internal Server Error happen, Database, Third Party etc.
func MethodNotAllowed ¶
NotFound will throw if the requested item is not exists
func UnauthorizedError ¶
Types ¶
type ErrorCode ¶
type ErrorCode struct { ErrorCode string `json:"error-code"` StatusCode int `json:"status-code"` MsgEn string `json:"msg-en"` MsgId string `json:"msg-id"` }
func GetErrorInfo ¶
type ErrorString ¶
func (ErrorString) Error ¶
func (e ErrorString) Error() string
Click to show internal directories.
Click to hide internal directories.