improve package gerror/ghttp for error code handling

This commit is contained in:
John Guo
2021-08-07 10:44:57 +08:00
parent 0f6820df9e
commit cd3593182a
10 changed files with 51 additions and 28 deletions

View File

@ -27,6 +27,7 @@ const (
CodeServerBusy = 63 // Server is busy, please try again later.
CodeUnknown = 64 // Unknown error.
CodeResourceNotExist = 65 // Resource does not exist.
CodeInvalidRequest = 66 // Invalid request.
CodeBusinessValidationFailed = 300 // Business validation failed.
)
@ -51,6 +52,7 @@ var (
CodeServerBusy: "Server Is Busy",
CodeUnknown: "Unknown Error",
CodeResourceNotExist: "Resource Not Exist",
CodeInvalidRequest: "Invalid Request",
CodeBusinessValidationFailed: "Business Validation Failed",
}
)