Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func NewError ¶
func NewError(httpStatuCode HttpStatusCode, errorCode ErrorCode, reason string) *Error
NewError 创建一个新的错误
func (*Error) HttpStatusCode ¶
type HttpStatusCode ¶
type HttpStatusCode int
HttpStatusCode 表示 HTTP 状态码
const ( // ErrBadRequest 400: 表示客户端发送的请求有错误 ErrBadRequest HttpStatusCode = http.StatusBadRequest ErrUnauthorized HttpStatusCode = http.StatusUnauthorized // ErrForbidden 403: 表示服务器拒绝请求 ErrForbidden HttpStatusCode = http.StatusForbidden // ErrNotFound 404: 表示请求的资源不存在 ErrNotFound HttpStatusCode = http.StatusNotFound // ErrMethodNotAllowed 405: 表示请求方法不允许 ErrMethodNotAllowed HttpStatusCode = http.StatusMethodNotAllowed // ErrNotAcceptable 406: 表示请求的资源不支持请求的格式 ErrNotAcceptable HttpStatusCode = http.StatusNotAcceptable // ErrInternalServerError 500: 表示服务器内部错误 ErrInternalServerError HttpStatusCode = http.StatusInternalServerError )
type ResponseErr ¶
ResponseErr 响应错误
Click to show internal directories.
Click to hide internal directories.