From b70b8e2b7221a573575638b38153fd2fdeeb5356 Mon Sep 17 00:00:00 2001 From: tobi Date: Tue, 7 Jan 2025 18:23:26 +0100 Subject: [PATCH] add more context to error logs --- internal/subscriptions/domainperms.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/subscriptions/domainperms.go b/internal/subscriptions/domainperms.go index de61abde5..0994cdaa7 100644 --- a/internal/subscriptions/domainperms.go +++ b/internal/subscriptions/domainperms.go @@ -147,7 +147,7 @@ func (s *Subscriptions) ProcessDomainPermissionSubscriptions( permSubs, err := s.state.DB.GetDomainPermissionSubscriptionsByPriority(ctx, permType) if err != nil && !errors.Is(err, db.ErrNoEntries) { // Real db error. - log.Error(ctx, err) + log.Errorf(ctx, "db error getting domain perm subs by priority: %v", err) return } @@ -161,7 +161,7 @@ func (s *Subscriptions) ProcessDomainPermissionSubscriptions( // we can reuse this for each HTTP call. tsport, err := s.transportController.NewTransportForUsername(ctx, "") if err != nil { - log.Error(ctx, err) + log.Errorf(ctx, "error getting transport for instance account: %v", err) return } @@ -179,7 +179,10 @@ func (s *Subscriptions) ProcessDomainPermissionSubscriptions( ) if err != nil { // Real db error. - log.Error(ctx, err) + log.Errorf(ctx, + "error processing domain permission subscription %s: %v", + permSub.URI, err, + ) return } @@ -187,7 +190,7 @@ func (s *Subscriptions) ProcessDomainPermissionSubscriptions( err = s.state.DB.UpdateDomainPermissionSubscription(ctx, permSub) if err != nil { // Real db error. - log.Error(ctx, err) + log.Errorf(ctx, "db error updating domain perm sub: %v", err) return } }