worker/clienterrors: add empty manifest error
If a manifest is empty we should have a specific error code for that case and treat it as a 4xx error since this would be bad input for a build job
This commit is contained in:
parent
62ab822695
commit
8241e1f948
2 changed files with 5 additions and 2 deletions
|
|
@ -124,12 +124,12 @@ func (impl *OSBuildKojiJobImpl) Run(job worker.Job) error {
|
|||
args.Manifest = manifestJR.Manifest
|
||||
if len(args.Manifest) == 0 {
|
||||
err := fmt.Errorf("Received empty manifest")
|
||||
result.JobError = clienterrors.WorkerClientError(clienterrors.ErrorManifestDependency, err.Error())
|
||||
result.JobError = clienterrors.WorkerClientError(clienterrors.ErrorEmptyManifest, err.Error())
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
err := fmt.Errorf("Job has no manifest")
|
||||
result.JobError = clienterrors.WorkerClientError(clienterrors.ErrorManifestDependency, err.Error())
|
||||
result.JobError = clienterrors.WorkerClientError(clienterrors.ErrorEmptyManifest, err.Error())
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue