handling bad status code

This commit is contained in:
yashsinghcodes
2025-05-21 22:22:17 +05:30
parent af6db1d432
commit 0344cc789b
+4
View File
@@ -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