# README
USAGE
1. Default errors
Error Name | Status (int) | Error Code (string) | Message |
---|---|---|---|
Success | 200 OK | 00 | Successful |
Failed | 200 OK | 01 | Failed. %s |
ValidationError | 200 OK | 02 | Validation error. %s |
NotFoundError | 200 OK | 03 | Not found error. %s |
OutboundError | 200 OK | 04 | Outbound error. %s |
TimeoutError | 200 OK | 05 | Timeout error. %s |
BadRequestError | 200 OK | 06 | Bad request error. %s |
UnauthorizedError | 200 OK | 07 | Unauthorized error. %s |
ForbiddenError | 200 OK | 08 | Forbidden error. %s |
MethodNotAllowedError | 200 OK | 09 | Method not allowed error. %s |
ConflictError | 200 OK | 10 | Conflict error. %s |
TooManyRequestError | 200 OK | 11 | Too many request error. %s |
InternalServerError | 500 Internal Server Error | 999 | Internal server error. %s |
2. Create dynamic func error
var (
UserNotActive = NewError(400, "54", "User not active")
)
func UserNotFound(userId int) error {
return NewError(400, "54", "User not found %d", userId)
}
# Functions
As finds the first error in err's chain that matches *Error.
No description provided by the author
authentication error with details.
Bad request error.
Bad request error with details.
Conflict error.
Conflict error with details.
No description provided by the author
Failed error.
Failed error with details.
Forbidden error.
Forbidden error with details.
FromError try to convert go error to *Error.
Internal server error.
Internal server error with details.
Method not allowed error.
Method not allowed error with details.
No description provided by the author
No description provided by the author
No row affected error.
No row affected error with details.
Not found error.
Not found error with details.
Outbound error.
Outbound error with details.
Parse tries to parse a JSON string into an error.
suspended error.
suspended error with details.
Timeout error.
Timeout error with details.
Too many request error.
Too many request error with details.
Unauthorized error.
Unauthorized error with details.
Deprecated: Used Failed with instead.
Validation error.
Validation error with details.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author