cloudapi: Add error information to ErrorUnknownUploadTarget
It can include useful extra details, whether or not the artifacts directory is setup, whether the file is missing, etc. Related: RHEL-60142
This commit is contained in:
parent
3781820b45
commit
a6f48bcd2f
1 changed files with 3 additions and 3 deletions
|
|
@ -365,7 +365,7 @@ func (h *apiHandlers) getJobIDComposeStatus(jobId uuid.UUID) (ComposeStatus, err
|
|||
tr := result.TargetResults[idx]
|
||||
us, err := h.targetResultToUploadStatus(jobId, tr)
|
||||
if err != nil {
|
||||
return ComposeStatus{}, HTTPError(ErrorUnknownUploadTarget)
|
||||
return ComposeStatus{}, HTTPErrorWithInternal(ErrorUnknownUploadTarget, err)
|
||||
}
|
||||
us.Status = uploadStatusFromJobStatus(jobInfo.JobStatus, result.JobError)
|
||||
statuses[idx] = *us
|
||||
|
|
@ -430,7 +430,7 @@ func (h *apiHandlers) getJobIDComposeStatus(jobId uuid.UUID) (ComposeStatus, err
|
|||
if tr.Name != target.TargetNameKoji {
|
||||
us, err := h.targetResultToUploadStatus(jobId, tr)
|
||||
if err != nil {
|
||||
return ComposeStatus{}, HTTPError(ErrorUnknownUploadTarget)
|
||||
return ComposeStatus{}, HTTPErrorWithInternal(ErrorUnknownUploadTarget, err)
|
||||
}
|
||||
us.Status = uploadStatusFromJobStatus(buildInfo.JobStatus, result.JobError)
|
||||
statuses = append(statuses, *us)
|
||||
|
|
@ -1191,7 +1191,7 @@ func (h *apiHandlers) postCloneComposeImpl(ctx echo.Context, id string) error {
|
|||
var us *UploadStatus
|
||||
us, err = h.targetResultToUploadStatus(jobId, osbuildResult.TargetResults[0])
|
||||
if err != nil {
|
||||
return HTTPError(ErrorUnknownUploadTarget)
|
||||
return HTTPErrorWithInternal(ErrorUnknownUploadTarget, err)
|
||||
}
|
||||
|
||||
var osbuildJob worker.OSBuildJob
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue