From e7abda6a0d94d66dd09afecdb6a277eba8ed3c05 Mon Sep 17 00:00:00 2001 From: oliverpool Date: Tue, 19 Mar 2024 16:00:48 +0100 Subject: [PATCH] actions artifacts: warn instead of error on invalid request --- routers/api/actions/artifacts.go | 2 +- routers/api/actions/artifacts_utils.go | 2 +- routers/api/actions/artifactsv4.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/routers/api/actions/artifacts.go b/routers/api/actions/artifacts.go index d530e9cee..2f8b3d021 100644 --- a/routers/api/actions/artifacts.go +++ b/routers/api/actions/artifacts.go @@ -311,7 +311,7 @@ func (ar artifactRoutes) comfirmUploadArtifact(ctx *ArtifactContext) { } artifactName := ctx.Req.URL.Query().Get("artifactName") if artifactName == "" { - log.Error("Error artifact name is empty") + log.Warn("Error artifact name is empty") ctx.Error(http.StatusBadRequest, "Error artifact name is empty") return } diff --git a/routers/api/actions/artifacts_utils.go b/routers/api/actions/artifacts_utils.go index aaf89ef40..d2e7ccaea 100644 --- a/routers/api/actions/artifacts_utils.go +++ b/routers/api/actions/artifacts_utils.go @@ -61,7 +61,7 @@ func validateArtifactHash(ctx *ArtifactContext, artifactName string) bool { if paramHash == artifactHash { return true } - log.Error("Invalid artifact hash: %s", paramHash) + log.Warn("Invalid artifact hash: %s", paramHash) ctx.Error(http.StatusBadRequest, "Invalid artifact hash") return false } diff --git a/routers/api/actions/artifactsv4.go b/routers/api/actions/artifactsv4.go index 8300989c7..5a251e2ef 100644 --- a/routers/api/actions/artifactsv4.go +++ b/routers/api/actions/artifactsv4.go @@ -359,7 +359,7 @@ func (r *artifactV4Routes) finalizeArtifact(ctx *ArtifactContext) { checksum = req.Hash.Value } if err := mergeChunksForArtifact(ctx, chunks, r.fs, artifact, checksum); err != nil { - log.Error("Error merge chunks: %v", err) + log.Warn("Error merge chunks: %v", err) ctx.Error(http.StatusInternalServerError, "Error merge chunks") return }