diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-25 19:42:20 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-25 19:42:20 +0900 |
| commit | f86d8682749dda2d0f6dc62d493389a5e0c8d88d (patch) | |
| tree | 66f7d9564545bbd790a12176cb3802959ba66389 /sandbox/output.go | |
| parent | 33940265a6c193fe024ad11b8c61a2869ef858d9 (diff) | |
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 <cat@gensokyo.uk>
Diffstat (limited to 'sandbox/output.go')
| -rw-r--r-- | sandbox/output.go | 7 |
1 files changed, 7 insertions, 0 deletions
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()) +} |
