From e3f5a129c1f1cc541fb75f6b3edff269fe1e5f53 Mon Sep 17 00:00:00 2001 From: brad-defined <77982333+brad-defined@users.noreply.github.com> Date: Wed, 31 Jan 2024 15:31:46 -0500 Subject: [PATCH] Return full error context from ContextualError.Error() (#1069) --- util/error.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/error.go b/util/error.go index a11c9c4..d7710f9 100644 --- a/util/error.go +++ b/util/error.go @@ -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 {