Add operation context to user-facing error messages

Prefix raw err.Error() strings surfaced in CR statuses and CLI stderr with the failed operation.

Signed-off-by: chlins <chlins.zhang@gmail.com>
(cherry picked from commit e03ff894ff)
This commit is contained in:
chlins
2026-09-03 10:43:08 +08:00
parent 6e8f61c35f
commit ef95718d26
8 changed files with 27 additions and 27 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ import (
func CheckError(err error) {
if err != nil {
if err != context.Canceled {
fmt.Fprintf(os.Stderr, "An error occurred: %v\n", err)
fmt.Fprintf(os.Stderr, "velero: %v\n", err)
}
os.Exit(1)
}