Skip to content

Commit

Permalink
Return full error context from ContextualError.Error() (#1069)
Browse files Browse the repository at this point in the history
  • Loading branch information
brad-defined authored Jan 31, 2024
1 parent 0f0534d commit e3f5a12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion util/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package util

import (
"errors"
"fmt"

"github.com/sirupsen/logrus"
)
Expand Down Expand Up @@ -40,7 +41,7 @@ func (ce *ContextualError) Error() string {
if ce.RealError == nil {
return ce.Context
}
return ce.RealError.Error()
return fmt.Errorf("%s (%v): %w", ce.Context, ce.Fields, ce.RealError).Error()
}

func (ce *ContextualError) Unwrap() error {
Expand Down

0 comments on commit e3f5a12

Please sign in to comment.