增加获取代表成功的异常

This commit is contained in:
zhangdeman committed 2022-06-25 22:36:11 +08:00
1 parent 03c01d829d
commit 42a85f7b80
1 file changed
+9
+9
View File
@@ -120,3 +120,12 @@ func ToError(e *Exception) error {
func IsSuccess(e *Exception) bool { func IsSuccess(e *Exception) bool {
return nil == e || e.GetCode() == defaultSuccessCode return nil == e || e.GetCode() == defaultSuccessCode
} }
// NewSuccess 代表Success的异常
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 22:35 2022/6/25
func NewSuccess(data map[string]interface{}) *Exception {
return New(defaultSuccessCode, defaultHttpCode, data)
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.