@@ -8,42 +8,42 @@ func NewAPIException(namespace string, code int, reason, format string, a ...int
88 code = - 1
99 }
1010
11- return newException (Namespace (namespace ), code , reason , format , a ... )
11+ return newException (Namespace (namespace ), code , format , a ... )
1212}
1313
1414// NewUnauthorized 未认证
1515func NewUnauthorized (format string , a ... interface {}) APIException {
16- return newException (usedNamespace , Unauthorized , codeReason ( Unauthorized ), format , a ... )
16+ return newException (usedNamespace , Unauthorized , format , a ... )
1717}
1818
1919// NewPermissionDeny 没有权限访问
2020func NewPermissionDeny (format string , a ... interface {}) APIException {
21- return newException (usedNamespace , Forbidden , codeReason ( Forbidden ), format , a ... )
21+ return newException (usedNamespace , Forbidden , format , a ... )
2222}
2323
2424// NewAccessTokenExpired 访问token过期
2525func NewAccessTokenExpired (format string , a ... interface {}) APIException {
26- return newException (usedNamespace , AccessTokenExpired , codeReason ( AccessTokenExpired ), format , a ... )
26+ return newException (usedNamespace , AccessTokenExpired , format , a ... )
2727}
2828
2929// NewRefreshTokenExpired 刷新token过期
3030func NewRefreshTokenExpired (format string , a ... interface {}) APIException {
31- return newException (usedNamespace , RefreshTokenExpired , codeReason ( RefreshTokenExpired ), format , a ... )
31+ return newException (usedNamespace , RefreshTokenExpired , format , a ... )
3232}
3333
3434// NewBadRequest todo
3535func NewBadRequest (format string , a ... interface {}) APIException {
36- return newException (usedNamespace , BadRequest , codeReason ( BadRequest ), format , a ... )
36+ return newException (usedNamespace , BadRequest , format , a ... )
3737}
3838
3939// NewNotFound todo
4040func NewNotFound (format string , a ... interface {}) APIException {
41- return newException (usedNamespace , NotFound , codeReason ( BadRequest ), format , a ... )
41+ return newException (usedNamespace , NotFound , format , a ... )
4242}
4343
4444// NewInternalServerError 500
4545func NewInternalServerError (format string , a ... interface {}) APIException {
46- return newException (usedNamespace , InternalServerError , codeReason ( InternalServerError ), format , a ... )
46+ return newException (usedNamespace , InternalServerError , format , a ... )
4747}
4848
4949// IsNotFoundError 判断是否是NotFoundError
0 commit comments