error.go 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package errors
  4. import (
  5. "google.golang.org/grpc/status"
  6. )
  7. var (
  8. // 通用错误
  9. SystemError = status.Error(10001, "系统错误")
  10. ServiceError = status.Error(10002, "内部服务错误")
  11. ParamsError = status.Error(10003, "参数错误")
  12. DataBaseError = status.Error(10004, "数据库错误")
  13. MqttError = status.Error(10004, "mqtt错误")
  14. RedisError = status.Error(10005, "Redis错误")
  15. VendorError = status.Error(10006, "三方错误")
  16. ElasticError = status.Error(10007, "ElasticSearch 错误")
  17. NoTokenError = status.Error(10008, "没有token")
  18. TokenExpiredError = status.Error(10009, "token已过期")
  19. TokenFailedError = status.Error(10010, "token错误")
  20. DistributeIdError = status.Error(10011, "分布式id错误")
  21. ErrRecordNotFound = status.Error(10012, "数据不存在")
  22. UserNotExist = status.Error(20201, "用户不存在")
  23. UserExist = status.Error(20202, "用户已存在")
  24. PasswordError = status.Error(20203, "密码错误")
  25. OrganizationNotExist = status.Error(20204, "机构不存在")
  26. OrganizationExist = status.Error(20205, "机构已存在")
  27. RbacNodeNotExist = status.Error(20206, "权限基础节点不存在")
  28. )