worker/errors: consider dep errors as 4xx status

All dependency errors, whether they are 4xx or 5xx,
are currently being considered as a 5xx error in parent
jobs. This is causing some of the build alerts to fire
off when a depsolve job has failed, for example, when
in reality, this is an expected result. This commit
ensures that dependency errors are being reported as
4xx status in monitoring.
This commit is contained in:
Gianluca Zuccarelli 2022-03-30 16:07:19 +01:00 committed by Sanne Raymaekers
parent 8241e1f948
commit cc7d555fb2

View file

@ -64,8 +64,12 @@ func GetStatusCode(err *Error) StatusCode {
return JobStatusUserInputError
case ErrorInvalidTarget:
return JobStatusUserInputError
case ErrorDepsolveDependency:
return JobStatusUserInputError
case ErrorManifestDependency:
return JobStatusUserInputError
case ErrorEmptyManifest:
return JobStatusInternalError
return JobStatusUserInputError
default:
return JobStatusInternalError
}