otter-space-sdk/internal/utils/error.go

14 lines
319 B
Go
Raw Normal View History

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
}