Skip to content

Commit 914467c

Browse files
Merge pull request #185 from wking/more-specific-unknown-error-reporting
Bug 1825003: pkg/payload/task: Include name/reason in "unknown error" message
2 parents e70a259 + 2b06b79 commit 914467c

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)