diff --git a/ttlError.go b/ttlError.go new file mode 100755 index 0000000..1806f8c --- /dev/null +++ b/ttlError.go @@ -0,0 +1,25 @@ +/* + * package error event + * Copyright (c) 2017 R&D. + * By guzeng + * 2018/01/05 + */ + +package ttlerr + +/** + * 定义error + */ + +type TTLError struct { + Code string + Msg string +} + +func (e TTLError) Error() string { + return e.Code + " | " + e.Msg +} + +func NewErr(code string, msg string) *TTLError { + return &TTLError{Code: code, Msg: msg} +}