错误处理
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
337 B

3 years ago
  1. /*
  2. * package error event
  3. * Copyright (c) 2017 R&D.
  4. * By guzeng
  5. * 2018/01/05
  6. */
  7. package ttlerr
  8. /**
  9. * 定义error
  10. */
  11. type TTLError struct {
  12. Code string
  13. Msg string
  14. }
  15. func (e TTLError) Error() string {
  16. return e.Code + " | " + e.Msg
  17. }
  18. func NewErr(code string, msg string) *TTLError {
  19. return &TTLError{Code: code, Msg: msg}
  20. }