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>
This commit is contained in:
2025-03-25 19:42:20 +09:00
parent 33940265a6
commit f86d868274
4 changed files with 28 additions and 21 deletions

View File

@@ -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())
}