Skip to content

fix: improve error handling for 404s to use UserInputError #366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2025

Conversation

dcramer
Copy link
Member

@dcramer dcramer commented Jul 9, 2025

  • Add reusable error handling utilities in api-utils.ts
  • Convert 404 API errors to UserInputError with clear messages
  • Handle HTML error pages from server errors separately
  • Update get-issue-details and update-issue tools to use new pattern
  • Add comprehensive tests for error handling utilities

This ensures users get helpful error messages when they provide invalid issue IDs instead of seeing raw API errors.

🤖 Generated with Claude Code

- Add reusable error handling utilities in api-utils.ts
- Convert 404 API errors to UserInputError with clear messages
- Handle HTML error pages from server errors separately
- Update get-issue-details and update-issue tools to use new pattern
- Add comprehensive tests for error handling utilities

This ensures users get helpful error messages when they provide invalid
issue IDs instead of seeing raw API errors.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link

codecov bot commented Jul 9, 2025

Codecov Report

Attention: Patch coverage is 88.77551% with 11 lines in your changes missing coverage. Please review.

Project coverage is 64.14%. Comparing base (04445c8) to head (47a3241).
Report is 5 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/mcp-server/src/tools/utils/api-utils.ts 85.00% 9 Missing ⚠️
packages/mcp-server/src/api-client/client.ts 80.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #366      +/-   ##
==========================================
+ Coverage   59.89%   64.14%   +4.24%     
==========================================
  Files          77       77              
  Lines        6635     7176     +541     
  Branches      512      713     +201     
==========================================
+ Hits         3974     4603     +629     
+ Misses       2661     2573      -88     
Flag Coverage Δ
unittests 64.14% <88.77%> (+4.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dcramer dcramer merged commit 205ccd5 into main Jul 9, 2025
13 checks passed
@dcramer dcramer deleted the improve-404s branch July 9, 2025 18:06
@dcramer dcramer restored the improve-404s branch July 10, 2025 17:29
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.

1 participant