14 lines
319 B
Go
14 lines
319 B
Go
|
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
|
||
|
}
|