|
@@ -2,10 +2,19 @@ package codes
|
|
|
|
|
|
|
|
import "github.com/go-kratos/kratos/v2/errors"
|
|
import "github.com/go-kratos/kratos/v2/errors"
|
|
|
|
|
|
|
|
-func SystemErr() error {
|
|
|
|
|
|
|
+func Error(code int32, msg string) error {
|
|
|
|
|
+ return errors.Error(code, "", msg)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func CommonErr(msg string) error {
|
|
|
|
|
+ return errors.Error(10400, "", msg)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func SystemErr(msg string) error {
|
|
|
return errors.Error(10500, "", "")
|
|
return errors.Error(10500, "", "")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 自定义返回值. 如自字重定向
|
|
|
func Customize() error {
|
|
func Customize() error {
|
|
|
return errors.Error(-1, "", "")
|
|
return errors.Error(-1, "", "")
|
|
|
}
|
|
}
|