Documentation ¶
Index ¶
- func ErrDuplicateAccount(w http.ResponseWriter, statusCode int)
- func ErrFailedConversion(w http.ResponseWriter, statusCode int)
- func ErrFailedMarshalBinaryLengthPrefixed(w http.ResponseWriter, statusCode int)
- func ErrFailedUnmarshalJSON(w http.ResponseWriter, statusCode int)
- func ErrInternalServer(w http.ResponseWriter, statusCode int)
- func ErrInvalidFormat(w http.ResponseWriter, statusCode int)
- func ErrInvalidMessageType(w http.ResponseWriter, statusCode int)
- func ErrInvalidParam(w http.ResponseWriter, statusCode int, msg string)
- func ErrNotAllowed(w http.ResponseWriter, statusCode int)
- func ErrNotExist(w http.ResponseWriter, statusCode int)
- func ErrOverMaxLimit(w http.ResponseWriter, statusCode int)
- func ErrRequiredParam(w http.ResponseWriter, statusCode int, msg string)
- func PrintException(w http.ResponseWriter, statusCode int, err WrapError)
- type ErrorCode
- type ErrorMsg
- type WrapError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrDuplicateAccount ¶
func ErrDuplicateAccount(w http.ResponseWriter, statusCode int)
func ErrFailedConversion ¶
func ErrFailedConversion(w http.ResponseWriter, statusCode int)
func ErrFailedMarshalBinaryLengthPrefixed ¶
func ErrFailedMarshalBinaryLengthPrefixed(w http.ResponseWriter, statusCode int)
func ErrFailedUnmarshalJSON ¶
func ErrFailedUnmarshalJSON(w http.ResponseWriter, statusCode int)
func ErrInternalServer ¶
func ErrInternalServer(w http.ResponseWriter, statusCode int)
func ErrInvalidFormat ¶
func ErrInvalidFormat(w http.ResponseWriter, statusCode int)
func ErrInvalidMessageType ¶
func ErrInvalidMessageType(w http.ResponseWriter, statusCode int)
func ErrInvalidParam ¶
func ErrInvalidParam(w http.ResponseWriter, statusCode int, msg string)
func ErrNotAllowed ¶
func ErrNotAllowed(w http.ResponseWriter, statusCode int)
func ErrNotExist ¶
func ErrNotExist(w http.ResponseWriter, statusCode int)
func ErrOverMaxLimit ¶
func ErrOverMaxLimit(w http.ResponseWriter, statusCode int)
func ErrRequiredParam ¶
func ErrRequiredParam(w http.ResponseWriter, statusCode int, msg string)
func PrintException ¶
func PrintException(w http.ResponseWriter, statusCode int, err WrapError)
PrintException prints out the exception result
Types ¶
type ErrorCode ¶
type ErrorCode uint32
ErrorCode represents custom error code used in this application.
const ( InternalServer ErrorCode = 101 DuplicateAccount ErrorCode = 201 InvalidFormat ErrorCode = 202 NotExist ErrorCode = 203 NotAllowed ErrorCode = 204 FailedConversion ErrorCode = 205 InvalidMessageType ErrorCode = 207 OverMaxLimit ErrorCode = 301 FailedUnmarshalJSON ErrorCode = 302 FailedMarshalBinaryLengthPrefixed ErrorCode = 303 RequiredParam ErrorCode = 601 InvalidParam ErrorCode = 602 )
type ErrorMsg ¶
type ErrorMsg string
ErrorMsg represents error message that will be returned to client for any error.
func ErrorCodeToErrorMsg ¶
ErrorCodeToErrorMsg returns error message from error code
func ErrorCodeToErrorMsgs ¶
ErrorCodeToErrorMsgs returns error message concatenating with custom message from error code
Click to show internal directories.
Click to hide internal directories.