1 Star 0 Fork 0

go-genie / statuserror

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
status_error__generated.go 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
lijun 提交于 2024-02-20 10:06 . feat:modify import path
package examples
import (
github_com_go_courier_statuserror "gitee.com/go-genie/statuserror"
)
var _ interface {
github_com_go_courier_statuserror.StatusError
} = (*StatusError)(nil)
func (v StatusError) StatusErr() *github_com_go_courier_statuserror.StatusErr {
return &github_com_go_courier_statuserror.StatusErr{
Key: v.Key(),
Code: v.Code(),
Msg: v.Msg(),
CanBeTalkError: v.CanBeTalkError(),
}
}
func (v StatusError) Unwrap() error {
return v.StatusErr()
}
func (v StatusError) Error() string {
return v.StatusErr().Error()
}
func (v StatusError) StatusCode() int {
return github_com_go_courier_statuserror.StatusCodeFromCode(int(v))
}
func (v StatusError) Code() int {
if withServiceCode, ok := (interface{})(v).(github_com_go_courier_statuserror.StatusErrorWithServiceCode); ok {
return withServiceCode.ServiceCode() + int(v)
}
return int(v)
}
func (v StatusError) Key() string {
switch v {
case Unauthorized:
return "Unauthorized"
case InternalServerError:
return "InternalServerError"
}
return "UNKNOWN"
}
func (v StatusError) Msg() string {
switch v {
case Unauthorized:
return "Unauthorized"
case InternalServerError:
return "InternalServerError"
}
return "-"
}
func (v StatusError) CanBeTalkError() bool {
switch v {
case Unauthorized:
return true
case InternalServerError:
return false
}
return false
}
1
https://gitee.com/go-genie/statuserror.git
git@gitee.com:go-genie/statuserror.git
go-genie
statuserror
statuserror
v1.0.1

搜索帮助