error.go 652 B

12345678910111213141516171819202122232425262728293031
  1. package db
  2. import "errors"
  3. var (
  4. ErrNoneConnect = errors.New(`not connect to database`)
  5. )
  6. // DB error code
  7. const (
  8. // ErrOK ok
  9. ErrOK = 0
  10. // ErrException exception 异常
  11. ErrException = 1
  12. // ErrExists exists 数据存在
  13. ErrExists = 2
  14. // ErrNotFound not found 未找到关键数据
  15. ErrNotFound = 3
  16. // ErrAuthorized authorized 未认证
  17. ErrAuthorized = 4
  18. // ErrNotConnect connect error 数据库内部连接错误
  19. ErrNotConnect = 5
  20. // data not found 数据未找到
  21. ErrDataNotFound = 6
  22. // expired 已过期
  23. ErrExpired = 7
  24. // insufficient balance 余额不足
  25. ErrInsufficientBalance = 8
  26. // Credit Limit 超额
  27. ErrCreditLimit = 9
  28. )