Return full error context from ContextualError.Error() (#1069)

This commit is contained in:
brad-defined 2024-01-31 15:31:46 -05:00 committed by GitHub
parent 0f0534d739
commit e3f5a129c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package util
import (
"errors"
"fmt"
"github.com/sirupsen/logrus"
)
@ -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 {