Skip to content

Commit db43569

Browse files
committed
handling non200 correctly
1 parent 6a78264 commit db43569

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

browserstack_ci_template.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,7 @@
120120
local error_message
121121
122122
status_code=$(echo "$response" | jq -r '.status_code')
123-
# todo-remove
124-
echo "Response Status Code in check_report_status: $status_code"
125123
body=$(echo "$response" | jq -r '.body')
126-
echo "Response body in check_report_status: body"
127124
128125
if [[ $status_code -ne 200 ]]; then
129126
echo "Error: API returned status code $status_code"
@@ -146,7 +143,11 @@
146143
147144
# Initial API Request
148145
RESPONSE=$(make_api_request "FIRST")
149-
check_report_status "$RESPONSE" || exit 0
146+
check_report_status "$RESPONSE"
147+
report_status_return=$?
148+
if [[ report_status_return -eq 1 ]]; then
149+
exit 0
150+
fi
150151
RETRY_COUNT=$(echo "$RESPONSE" | jq -r '.body.retryCount // 3')
151152
POLLING_DURATION=$(echo "$RESPONSE" | jq -r '.body.pollingInterval // 3')
152153

0 commit comments

Comments
 (0)