Skip to content

Dont ignore MCP exceptions from backend#11

Merged
awrobel-gd merged 3 commits into
mainfrom
mcp-dont-ignore-exceptions
Jul 3, 2026
Merged

Dont ignore MCP exceptions from backend#11
awrobel-gd merged 3 commits into
mainfrom
mcp-dont-ignore-exceptions

Conversation

@awrobel-gd

Copy link
Copy Markdown
Contributor

No description provided.

@awrobel-gd awrobel-gd self-assigned this Jul 1, 2026
akozak-gd
akozak-gd previously approved these changes Jul 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 via BackendContractRejection.
  • Add test coverage for call_backend() success, structured/unstructured HTTP errors, and connection errors.
  • Extend the test fake HTTP client to support GET and DELETE to exercise the new call_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.

Comment thread mcp_server/services/specflow_backend.py Outdated
Comment thread mcp_server/tests/test_backend_contract_rejection.py
Comment thread mcp_server/tests/test_backend_contract_rejection.py
…httpx.ConnectError is properly caught and not mistaken for httpx.HTTPError
@awrobel-gd awrobel-gd merged commit 40da48a into main Jul 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants