Documentation ¶
Index ¶
- func GetHttpStatusText(httpStatus int) string
- type CommonError
- func (err CommonError) Error() string
- func (err CommonError) GetHttpStatus() int
- func (err *CommonError) SetClientMessage(message string)
- func (err *CommonError) SetSystemMessage(message interface{})
- func (err *CommonError) SetValidationMessage(message interface{})
- func (err CommonError) ToHttpError() HttpError
- type ErrorCode
- type ErrorDictionaries
- type HttpError
- type ValidationErrors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHttpStatusText ¶
Types ¶
type CommonError ¶
type CommonError struct { ClientMessage string `json:"message"` SystemMessage interface{} `json:"data"` ValidationErrors ValidationErrors `json:"validationErrors,omitempty"` ErrorCode ErrorCode `json:"code"` ErrorMessage *string `json:"-"` ErrorTrace *string `json:"-"` }
func NewCommonError ¶
func NewCommonError(errCode ErrorCode, err error) *CommonError
func (CommonError) Error ¶
func (err CommonError) Error() string
func (CommonError) GetHttpStatus ¶
func (err CommonError) GetHttpStatus() int
func (*CommonError) SetClientMessage ¶
func (err *CommonError) SetClientMessage(message string)
func (*CommonError) SetSystemMessage ¶
func (err *CommonError) SetSystemMessage(message interface{})
func (*CommonError) SetValidationMessage ¶
func (err *CommonError) SetValidationMessage(message interface{})
func (CommonError) ToHttpError ¶
func (err CommonError) ToHttpError() HttpError
type ErrorDictionaries ¶
type ErrorDictionaries struct {
// contains filtered or unexported fields
}
func RegisterErrorDictionaries ¶
func RegisterErrorDictionaries( errorCodes map[ErrorCode]*CommonError, httpCodes map[ErrorCode]int, ) *ErrorDictionaries
type HttpError ¶
type HttpError struct { CommonError HttpStatusNumber int `json:"-"` HttpStatusName string `json:"type"` }
type ValidationErrors ¶
Click to show internal directories.
Click to hide internal directories.