Ver código fonte

add ParseErrorMsg

dcsunny 2 anos atrás
pai
commit
780d76514b
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      codes/code.go

+ 5 - 0
codes/code.go

@@ -66,6 +66,11 @@ func ParseError(err error) (int, string) {
 	return ParseErrorWithData(err, nil)
 }
 
+func ParseErrorMsg(err error) string {
+	_, msg := ParseErrorWithData(err, nil)
+	return msg
+}
+
 func ErrorEqual(err1 error, err2 error) bool {
 	code1, msg1 := ParseError(err1)
 	code2, msg2 := ParseError(err2)