Skip to content

Commit d78f586

Browse files
committed
Log action errors (#164)
Previously we only directed the user to the logfile, but there are some errors that are independent of the action's step: failing to fetch the ZIP archive, failing to extract ZIP archive, etc. Those are not in the logfiles and as it turns out we never logged them. This change fixes that.
1 parent 1f2d31b commit d78f586

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cmd/src/actions_exec_logger.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ func (a *actionLogger) RepoFinished(repoName string, patchProduced bool, actionE
159159

160160
if actionErr != nil {
161161
if a.keepLogs {
162-
a.write(repoName, boldRed, "Action failed. Logfile: %s\n", f.Name())
162+
a.write(repoName, boldRed, "Action failed: %q (Logfile: %s)\n", actionErr, f.Name())
163163
} else {
164-
a.write(repoName, boldRed, "Action failed.\n")
164+
a.write(repoName, boldRed, "Action failed: %q\n", actionErr)
165165
}
166166
} else if patchProduced {
167167
a.write(repoName, boldGreen, "Finished. Patch produced.\n")

cmd/src/actions_terminal_ui.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func newTerminalUI(keepLogs bool) func(reposMap map[ActionRepo]ActionRepoStatus)
7373
case status.Cached || !status.FinishedAt.IsZero():
7474
if status.Err != nil {
7575
statusColor = color.RedString
76-
statusText = "error: see " + status.LogFile
76+
statusText = fmt.Sprintf("error: %q (see %s)", status.Err, status.LogFile)
7777
logFileText = "" // don't show twice
7878
} else {
7979
statusColor = color.GreenString

0 commit comments

Comments
 (0)