From 0344cc789b8e1d4427ed9a8efcdff7550a1b9f33 Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Wed, 21 May 2025 22:22:17 +0530 Subject: [PATCH] handling bad status code --- functions/onprem/worker/worker.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/functions/onprem/worker/worker.go b/functions/onprem/worker/worker.go index 6c2681eb..cde2484c 100644 --- a/functions/onprem/worker/worker.go +++ b/functions/onprem/worker/worker.go @@ -2368,6 +2368,10 @@ func getWorkerBackendExecution(auth string, executionId string) (*shuffle.Workfl } defer newresp.Body.Close() + if newresp.StatusCode != 200 { + return workflowExecution, errors.New(fmt.Sprintf("Got bad status code from backend %d", newresp.StatusCode)) + } + body, err := ioutil.ReadAll(newresp.Body) if err != nil { return workflowExecution, err