ソースを参照

feat: 添加msg接口

SongZihuan 1 年間 前
コミット
269a3ac8d7
1 ファイル変更5 行追加0 行削除
  1. 5 0
      errors.go

+ 5 - 0
errors.go

@@ -12,6 +12,7 @@ type WTError interface {
 	/* 访问类操作 */
 	Class() WTErrorClass
 	Code() string
+	Msg() string
 	Message() string
 	MessageWithStack() string
 	Stack() string
@@ -43,6 +44,10 @@ func (w *wtError) Code() string {
 	return w.code
 }
 
+func (w *wtError) Msg() string {
+	return w.msg
+}
+
 func (w *wtError) Message() string {
 	if w.cause == nil {
 		return fmt.Sprintf("[%s] %s", w.code, w.msg)