osbuild-worker: tweak error to not include a \n for a failed stage
Small followup for https://github.com/osbuild/osbuild-composer/pull/4113#discussion_r1670063775 Given that the failed stage is a relatively short string the `\n` seems unneccessary and quotes are enough.
This commit is contained in:
parent
4ba7085068
commit
919b423953
2 changed files with 3 additions and 4 deletions
|
|
@ -372,8 +372,8 @@ func makeJobErrorFromOsbuildOutput(osbuildOutput *osbuild.Result) *clienterrors.
|
|||
}
|
||||
|
||||
reason := "osbuild build failed"
|
||||
if len(failedStage) > 0 {
|
||||
reason += " in stage:\n" + failedStage
|
||||
if failedStage != "" {
|
||||
reason += fmt.Sprintf(" in stage: %q", failedStage)
|
||||
}
|
||||
return clienterrors.WorkerClientError(clienterrors.ErrorBuildJob, reason, osbErrors)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@ func TestMakeJobErrorFromOsbuildOutput(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
expected: `Code: 10, Reason: osbuild build failed in stage:
|
||||
bad-stage, Details: []`,
|
||||
expected: `Code: 10, Reason: osbuild build failed in stage: "bad-stage", Details: []`,
|
||||
},
|
||||
{
|
||||
inputData: &osbuild.Result{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue