From cc7d555fb211fda248546d5ea5d8bb18069da886 Mon Sep 17 00:00:00 2001 From: Gianluca Zuccarelli Date: Wed, 30 Mar 2022 16:07:19 +0100 Subject: [PATCH] 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. --- internal/worker/clienterrors/errors.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/worker/clienterrors/errors.go b/internal/worker/clienterrors/errors.go index 7d1075c0c..c288f2bfe 100644 --- a/internal/worker/clienterrors/errors.go +++ b/internal/worker/clienterrors/errors.go @@ -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 }