github.com/profzone/eden-framework@v1.0.10/pkg/courier/status_error/status_err_codes.go (about)

     1  package status_error
     2  
     3  import (
     4  	"net/http"
     5  )
     6  
     7  const (
     8  	// 内部未明确定义的错误
     9  	UnknownError StatusErrorCode = http.StatusInternalServerError*1e6 + 1 + iota
    10  	// 内部用于接收参数时非法的结构
    11  	InvalidStruct
    12  	// Read 调用时发生错误
    13  	ReadFailed
    14  	// 请求参数错误
    15  	InvalidRequestParams
    16  	// HTTP 请求下游失败
    17  	HttpRequestFailed
    18  	// 内部参数错误
    19  	InternalParams
    20  	// 请求 url 错误
    21  	ProtocolParseFailed
    22  	// 请求超时
    23  	RequestTimeout
    24  )
    25  
    26  const (
    27  	// http method 不允许
    28  	StatusMethodNotAllowed StatusErrorCode = http.StatusMethodNotAllowed*1e6 + 1 + iota
    29  )
    30  
    31  const (
    32  	// @errTalk 请求 JSON 格式错误
    33  	InvalidBodyStruct StatusErrorCode = http.StatusBadRequest*1e6 + 1 + iota
    34  	// @errTalk 请求参数格式错误
    35  	InvalidNonBodyParameters
    36  	// @errTalk 请求参数格式不匹配
    37  	InvalidField
    38  	// @errTalk 解析表单数据失败
    39  	ParseFormFailed
    40  	// @errTalk 读取表单文件数据失败
    41  	ReadFormFileFailed
    42  	// @errTalk 非法签名
    43  	InvalidSecret
    44  )
    45  
    46  const (
    47  	// @errTalk 验签失败
    48  	SignFailed StatusErrorCode = http.StatusUnauthorized*1e6 + 1 + iota
    49  )