# README
errors
从 Kratos 项目借鉴来的错误处理包。
# Packages
No description provided by the author
# Functions
Aborted creates an Error with codes.Aborted which mapping to HTTP code 409.
AlreadyExists creates an Error with codes.AlreadyExists which mapping to HTTP code 409.
As finds the first error in err's chain that matches target, and if so, sets target to that error value and returns true.
Canceled creates an Error with codes.Canceled which mapping to HTTP code 499.
Clone deep clones Error to a new Error.
Code returns the code for an error.
DataLoss creates an Error with codes.DataLoss which mapping to HTTP code 500.
DeadlineExceeded creates an Error with codes.DeadlineExceeded which mapping to HTTP code 504.
Errorf returns an error object for the code, message and error info.
FailedPrecondition creates an Error with codes.FailedPrecondition which mapping to HTTP code 400.
FromError try to convert an error to *Error.
Internal creates an Error with codes.Internal which mapping to HTTP code 500.
InvalidArgument creates an Error with codes.InvalidArgument which mapping to HTTP code 400.
Is reports whether any error in err's chain matches target.
IsAborted checks if an error is an Error with codes.Aborted which mapping to HTTP code 409.
IsAlreadyExists checks if an error is an Error with codes.AlreadyExists which mapping to HTTP code 409.
IsCanceled checks if an error is an Error with codes.Canceled which mapping to HTTP code 499.
IsDataLoss checks if an error is an Error with codes.DataLoss which mapping to HTTP code 500.
IsDeadlineExceeded checks if an error is an Error with codes.DeadlineExceeded which mapping to HTTP code 504.
IsFailedPrecondition checks if an error is an Error with codes.FailedPrecondition which mapping to HTTP code 400.
IsInternal checks if an error is an Error with codes.Internal which mapping to HTTP code 500.
IsInvalidArgument checks if an error is an Error with codes.InvalidArgument which mapping to HTTP code 400.
IsNotFound checks if an error is an Error with codes.NotFound which mapping to HTTP code 404.
IsOutOfRange checks if an error is an Error with codes.OutOfRange which mapping to HTTP code 400.
IsPermissionDenied checks if an error is an Error with codes.PermissionDenied which mapping to HTTP code 403.
IsResourceExhausted checks if an error is an Error with codes.ResourceExhausted which mapping to HTTP code 429.
IsUnauthenticated checks if an error is an Error with codes.Unauthenticated which mapping to HTTP code 401.
IsUnavailable checks if an error is an Error with codes.Unavailable which mapping to HTTP code 503.
IsUnimplemented checks if an error is an Error with codes.Unimplemented which mapping to HTTP code 501.
IsUnknown checks if an error is an Error with codes.Unknown which mapping to HTTP code 500.
New returns an Error for the code, reason and message.
Newf is same as New(code, reason, fmt.Sprintf(format, a...)).
NotFound creates an Error with codes.NotFound which mapping to HTTP code 404.
OutOfRange creates an Error with codes.OutOfRange which mapping to HTTP code 400.
PermissionDenied creates an Error with codes.PermissionDenied which mapping to HTTP code 403.
Reason returns the reason for a particular error.
ResourceExhausted creates an Error with codes.ResourceExhausted which mapping to HTTP code 429.
Unauthenticated creates an Error with codes.Unauthenticated which mapping to HTTP code 401.
Unavailable creates an Error with codes.Unavailable which mapping to HTTP code 503.
Unimplemented creates an Error with codes.Unimplemented which mapping to HTTP code 501.
Unknown creates an Error with codes.Unknown which mapping to HTTP code 500.
Unwrap returns the result of calling the Unwrap method on err, if err's type contains an Unwrap method returning error.
# Constants
ClientClosedHttpCode is non-standard http status code, which defined by nginx.
SupportPackageIsVersion1 is used for generation validating, and this constant should not be referenced by any other code.
UnknownReason is unknown reason for error info.
# Variables
optional google.rpc.Code code = 1110;.
optional google.rpc.Code default_code = 1109;.
optional bool error_define = 1108;.
optional int32 force_http_code = 1111;.
No description provided by the author