package
0.0.36
Repository: https://github.com/origadmin/toolkits.git
Documentation: pkg.go.dev

# Functions

BadRequest generates a 400 error.
Code returns the code of an error.
Conflict generates a 409 error.
Equal tries to compare errors, which are equal if they have the same NewCode.
Forbidden generates a 403 error.
FromError tries to convert a Go error to *Error.
InternalServerError generates a 500 error.
LookupID looks up the identifier corresponding to the given code.
MethodNotAllowed generates a 405 error.
New generates an Error error.
NewCode generates an error for a given code.
NewCodeFormat generates an error for a given code.
NewFormat generates an Error error.
NotFound generates a 404 error.
Parse tries to parse a JSON string into an error.
RegisterCode register a new error code with the given ID,or overwriting any existing one.
RequestEntityTooLarge generates a 413 error.
Timeout generates a 408 error.
TooManyRequests generates a 429 error.
Unauthorized generates a 401 error.

# Constants

ID for Bad Request status.
ID for Conflict status.
ID for Forbidden status.
ID for Internal Server Error status.
ID for Method Not Allowed status.
ID for Not Found status.
ID for Request Entity Too Large status.
ID for Request Timeout status.
ID for Too Many Requests status.
ID for Unauthorized status.
ID for Unknown status.

# Structs

Error customize the error structure for implementation errors.Error interface.