bank.go 1018 B

1234567891011121314151617181920212223242526272829303132
  1. package taxerr
  2. import "fmt"
  3. // NewBankSystemError 创建银行任务系统异常
  4. func NewBankSystemError(bank, reason, operation string) error {
  5. return &SystemErr{
  6. Msg: fmt.Sprintf("[异常]: [%s] %s [操作]: %s", bank, reason, operation),
  7. }
  8. }
  9. // NewBankUserError 创建银行任务用户错误
  10. func NewBankUserError(bank, reason, operation string) error {
  11. return &UserErr{
  12. Msg: fmt.Sprintf("[错误]: [%s] %s [操作]: %s", bank, reason, operation),
  13. }
  14. }
  15. // 创建没有银行账户错误
  16. func NewErrNoAccount(bank string) error {
  17. return NewBankUserError(bank, "网银无银行账户", "请手动登录网银确认账户是否正常")
  18. }
  19. // 创建银行主账号不存在错误
  20. func NewErrAccountNotFound(bank string) error {
  21. return NewBankUserError(bank, "指定的银行主账号不存在", "请核实后再发起采集")
  22. }
  23. // 创建银行账户匹配失败错误
  24. func NewErrAccMismatch(bank string) error {
  25. return NewBankUserError(bank, "银行账户匹配失败", "请联系运维人员处理")
  26. }