mirror of
https://github.com/foomo/keel.git
synced 2025-10-16 12:35:34 +00:00
refactor: resolve error type from error
This commit is contained in:
parent
85deceec62
commit
0ec788f20b
@ -1,6 +1,8 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@ -14,8 +16,8 @@ func FError(err error) zap.Field {
|
||||
return zap.NamedError(ErrorMessageKey, err)
|
||||
}
|
||||
|
||||
func FErrorType(errType string) zap.Field {
|
||||
return zap.String(ErrorTypeKey, errType)
|
||||
func FErrorType(err error) zap.Field {
|
||||
return zap.String(ErrorTypeKey, reflect.TypeOf(err).String())
|
||||
}
|
||||
|
||||
func FStackSkip(skip int) zap.Field {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user