Dont ignore MCP exceptions from backend#11
Merged
Conversation
akozak-gd
previously approved these changes
Jul 1, 2026
There was a problem hiding this comment.
Pull request overview
This PR changes the SpecFlow MCP backend client so that call_backend() raises on HTTP/network errors (instead of returning a non-JSON "Error calling backend: ..." string), and adds regression tests to ensure backend error details (including structured contract rejections) surface correctly.
Changes:
- Update
SpecFlowBackendService.call_backend()to raise on non-2xx responses and propagate structured 400 “contract rejection” details viaBackendContractRejection. - Add test coverage for
call_backend()success, structured/unstructured HTTP errors, and connection errors. - Extend the test fake HTTP client to support
GETandDELETEto exercise the newcall_backend()paths.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| mcp_server/services/specflow_backend.py | Changes call_backend() from returning error strings to raising exceptions (and typed contract rejections) on failures. |
| mcp_server/tests/test_backend_contract_rejection.py | Adds regression tests for call_backend() error handling and updates the fake client to support more HTTP methods. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…arity and error handling
…httpx.ConnectError is properly caught and not mistaken for httpx.HTTPError
akozak-gd
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.