From 2b06b79fefcd1d2fb72aadb321ef1e7586b7517a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 14 May 2019 13:10:26 -0700 Subject: [PATCH] pkg/payload/task: Include name/reason in "unknown error" message Because this makes it easier to grow the SummaryForReason logic. The previous, generic error message is not very useful (e.g. as seen in [1]). [1]: https://bugzilla.redhat.com/show_bug.cgi?id=1710012#c0 --- pkg/payload/task.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/payload/task.go b/pkg/payload/task.go index 83eb4367aa..ec436c8142 100644 --- a/pkg/payload/task.go +++ b/pkg/payload/task.go @@ -222,5 +222,9 @@ func SummaryForReason(reason, name string) string { if strings.HasPrefix(reason, "UpdatePayload") { return "the update could not be applied" } - return "an unknown error has occurred" + + if len(name) > 0 { + return fmt.Sprintf("%s has an unknown error: %s", name, reason) + } + return fmt.Sprintf("an unknown error has occurred: %s", reason) }