SDK v3 #8
13
internal/utils/error.go
Normal file
13
internal/utils/error.go
Normal file
@ -0,0 +1,13 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"context"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
func HandleError(ctx context.Context, span trace.Span, logger *log.Logger, fields log.Fields, error error) error {
|
||||
logger.WithContext(ctx).WithFields(fields).Error(error)
|
||||
span.RecordError(error)
|
||||
return error
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user