Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a summary of error messages in pipeline builds #472

Merged
merged 4 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,13 @@ def finalizeBuildProcess(Map args) {
println("** Build State : $state")
if (props.preview) println("** Build ran in preview mode.")
println("** Total files processed : ${args.count}")
if (props.errorSummary) {
println("** Summary of error messages")
println("${props.errorSummary}")
}
println("** Total build time : $duration\n")



// if error occurred signal process error
if (props.error)
Expand Down
3 changes: 2 additions & 1 deletion utilities/BuildUtilities.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ def updateBuildResult(Map args) {
if (args.errorMsg) {
buildResult.setStatus(buildResult.ERROR)
buildResult.addProperty("error", args.errorMsg)

errorSummary = (props.errorSummary) ? "${props.errorSummary} ${args.errorMsg}\n" : " ${args.errorMsg}\n"
props.put("errorSummary", "$errorSummary")
}

// add warning message, but keep result status
Expand Down