-
-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Description
oopsError.Context() causes panics when with
contains a nil ptr
var id *int
err := oops.With("id", id).Errorf("myError")
if oopsError := errors.As(err, &oops.OopsError{}); oopsError {
oopsError.Context()
}
This will give panic: reflect: call of reflect.Value.Interface on zero Value
and can cause error logs to panic and a lost error message and stacktrace.
For example with logrus.WithError(err).Error("Error")
Maybe the error is in kv.go dereferencePointers
and need a check that the elem CanInterface?
elem := val.Elem()
if elem.CanInterface() {
data[key] = elem.Interface()
} else {
data[key] = elem // not sure here
}
mlu1109
Metadata
Metadata
Assignees
Labels
No labels