From f86d8682749dda2d0f6dc62d493389a5e0c8d88d Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 25 Mar 2025 19:42:20 +0900 Subject: sandbox: wrap error with its own text message PathError has a pretty good text message, many of them are wrapped with its own text message. This change adds a function to do just that to improve readability. Signed-off-by: Ophestra --- sandbox/output.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sandbox/output.go') diff --git a/sandbox/output.go b/sandbox/output.go index de4a104a..5d74395b 100644 --- a/sandbox/output.go +++ b/sandbox/output.go @@ -17,3 +17,10 @@ func wrapErrSuffix(err error, a ...any) error { } return msg.WrapErr(err, append(a, err)...) } + +func wrapErrSelf(err error) error { + if err == nil { + return nil + } + return msg.WrapErr(err, err.Error()) +} -- cgit v1.3.1