-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add flag to write job reports to disk (#2298)
* Add flag to write job reports to disk * Fix nil pointer / non-nil interface bug * Synchronize job report writer goroutine * Log when the report has been written
- Loading branch information
1 parent
698a20b
commit 4a4bb89
Showing
3 changed files
with
77 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package common | ||
|
||
// ExportError is an implementation of error that can be JSON marshalled. It | ||
// must be a public exported type for this reason. | ||
type ExportError string | ||
|
||
func (e ExportError) Error() string { return string(e) } | ||
|
||
// ExportErrors converts a list of errors into []ExportError. | ||
func ExportErrors(errs ...error) []error { | ||
output := make([]error, 0, len(errs)) | ||
for _, err := range errs { | ||
output = append(output, ExportError(err.Error())) | ||
} | ||
return output | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters