cloudapi/v2: add error object to ImageStatus
Add an error object to the ComposeStatus.ImageStatus. The error object contains a human-readable error reason and optional details in the case of an error.
This commit is contained in:
parent
63a0bbc1f2
commit
761aab6cac
5 changed files with 138 additions and 81 deletions
|
|
@ -147,7 +147,7 @@ func (s *Server) OSBuildJobStatus(id uuid.UUID, result *OSBuildJobResult) (*JobS
|
|||
return nil, nil, fmt.Errorf("expected osbuild:*, found %q job instead", jobType)
|
||||
}
|
||||
|
||||
if result.JobError == nil {
|
||||
if result.JobError == nil && !status.Finished.IsZero() {
|
||||
if result.OSBuildOutput == nil {
|
||||
result.JobError = clienterrors.WorkerClientError(clienterrors.ErrorBuildJob, "osbuild build failed")
|
||||
} else if len(result.OSBuildOutput.Error) > 0 {
|
||||
|
|
@ -175,7 +175,7 @@ func (s *Server) OSBuildKojiJobStatus(id uuid.UUID, result *OSBuildKojiJobResult
|
|||
return nil, nil, fmt.Errorf("expected \"osbuild-koji:*\", found %q job instead", jobType)
|
||||
}
|
||||
|
||||
if result.JobError == nil {
|
||||
if result.JobError == nil && !status.Finished.IsZero() {
|
||||
if result.OSBuildOutput == nil {
|
||||
result.JobError = clienterrors.WorkerClientError(clienterrors.ErrorBuildJob, "osbuild build failed")
|
||||
} else if len(result.OSBuildOutput.Error) > 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue