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
|
package log
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"reflect"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -14,8 +16,8 @@ func FError(err error) zap.Field {
|
|||||||
return zap.NamedError(ErrorMessageKey, err)
|
return zap.NamedError(ErrorMessageKey, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func FErrorType(errType string) zap.Field {
|
func FErrorType(err error) zap.Field {
|
||||||
return zap.String(ErrorTypeKey, errType)
|
return zap.String(ErrorTypeKey, reflect.TypeOf(err).String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func FStackSkip(skip int) zap.Field {
|
func FStackSkip(skip int) zap.Field {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user