Skip to content

Commit b3c3e54

Browse files
committed
Refactor error handling in /compile-and-fix endpoint to improve clarity and maintainability
1 parent 82b330c commit b3c3e54

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

.github/workflows/test-mcp-server.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -284,21 +284,21 @@ jobs:
284284
\"code\": $(echo "$GENERATE_OUTPUT" | jq -Rs .)
285285
}" || echo "CURL_FAILED")
286286

287-
if [ "$COMPILE_RESPONSE" = "CURL_FAILED" ]; then
288-
echo "Failed to connect to API service"
289-
docker ps
290-
exit 1
291-
fi
292-
293-
# Check for success in response
294-
if ! echo "$COMPILE_RESPONSE" | jq -e '.success == true' > /dev/null; then
295-
echo "Compilation failed:"
296-
echo "$COMPILE_RESPONSE" | jq || echo "$COMPILE_RESPONSE"
297-
exit 1
298-
fi
299-
300-
echo "Workflow test successful! Generated code compiles correctly."
301-
echo "$COMPILE_RESPONSE" | jq || echo "$COMPILE_RESPONSE"
287+
if [ "$COMPILE_RESPONSE" = "CURL_FAILED" ]; then
288+
echo "Failed to connect to API service"
289+
docker ps
290+
exit 1
291+
fi
292+
293+
# Check for success in response
294+
if ! echo "$COMPILE_RESPONSE" | jq -e '.success == true' > /dev/null; then
295+
echo "Compilation failed:"
296+
echo "$COMPILE_RESPONSE" | jq || echo "$COMPILE_RESPONSE"
297+
exit 1
298+
fi
299+
300+
echo "Workflow test successful! Generated code compiles correctly."
301+
echo "$COMPILE_RESPONSE" | jq || echo "$COMPILE_RESPONSE"
302302

303303
- name: Test basic API endpoints (non-LLM)
304304
run: |

0 commit comments

Comments
 (0)