Skip to content

Commit 2b06b79

Browse files
committed
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
1 parent 07e65a3 commit 2b06b79

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/payload/task.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,5 +222,9 @@ func SummaryForReason(reason, name string) string {
222222
if strings.HasPrefix(reason, "UpdatePayload") {
223223
return "the update could not be applied"
224224
}
225-
return "an unknown error has occurred"
225+
226+
if len(name) > 0 {
227+
return fmt.Sprintf("%s has an unknown error: %s", name, reason)
228+
}
229+
return fmt.Sprintf("an unknown error has occurred: %s", reason)
226230
}

0 commit comments

Comments
 (0)