From 4542717e1ad0001310bbb6b25328ee153e5208ad Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 4 Jun 2024 11:55:37 +0200 Subject: i18nerr: Make sure unwrapping for internal errors still work --- i18nerr/i18nerr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'i18nerr') diff --git a/i18nerr/i18nerr.go b/i18nerr/i18nerr.go index 3e807f2..168cf84 100644 --- a/i18nerr/i18nerr.go +++ b/i18nerr/i18nerr.go @@ -150,7 +150,7 @@ func NewInternalf(disp string, args ...interface{}) *Error { // WrapInternal wraps an error and a display string into a localised internal error func WrapInternal(err error, disp string) *Error { - return NewInternal(fmt.Sprintf("%s with internal cause: %v", disp, err)) + return Wrap(fmt.Errorf("%s with internal cause: %w", disp, err), "An internal error occurred") } // WrapInternalf wraps an error and a display string with args into a localised internal error -- cgit v1.2.3