Optimize. (#51)

This commit is contained in:
Nuno Cruces
2024-01-11 02:18:12 +00:00
committed by GitHub
parent 97f2b73701
commit 6b0c2c0554
12 changed files with 147 additions and 85 deletions

View File

@@ -138,14 +138,14 @@ func (e ExtendedErrorCode) Timeout() bool {
func errorCode(err error, def ErrorCode) (msg string, code uint32) {
switch code := err.(type) {
case nil:
return "", _OK
case ErrorCode:
return "", uint32(code)
case ExtendedErrorCode:
case xErrorCode:
return "", uint32(code)
case *Error:
return code.msg, uint32(code.code)
case nil:
return "", _OK
}
var ecode ErrorCode