Skip to content

Conversation

@shivasurya
Copy link
Owner

@shivasurya shivasurya commented Jan 10, 2026

Summary

Implements comprehensive error handling following JSON-RPC 2.0 specification.

Error codes implemented:

Code Name Description
-32700 Parse Error Invalid JSON
-32600 Invalid Request Missing required fields
-32601 Method Not Found Unknown method
-32602 Invalid Params Invalid parameters
-32603 Internal Error Server error
-32001 Symbol Not Found Symbol lookup failed
-32002 Index Not Ready Index still building
-32003 Query Timeout Query exceeded timeout

Features:

  • Structured error responses with data field
  • Helper functions for common errors
  • Parameter validation utilities
  • Full test coverage for all error types

@codecov
Copy link

codecov bot commented Jan 10, 2026

Codecov Report

❌ Patch coverage is 98.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.02%. Comparing base (34eafd1) to head (c59df07).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sast-engine/mcp/server.go 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #456      +/-   ##
==========================================
+ Coverage   80.86%   81.02%   +0.16%     
==========================================
  Files          89       90       +1     
  Lines        9849     9936      +87     
==========================================
+ Hits         7964     8051      +87     
  Misses       1575     1575              
  Partials      310      310              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shivasurya shivasurya marked this pull request as ready for review January 10, 2026 04:05
@safedep
Copy link

safedep bot commented Jan 10, 2026

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

This report is generated by SafeDep Github App

@shivasurya shivasurya force-pushed the shiva/mcp-test-infrastructure branch from 2ec0ebf to 67c6510 Compare January 10, 2026 04:43
@shivasurya shivasurya force-pushed the shiva/mcp-error-handling branch from cce2c7b to b265133 Compare January 10, 2026 04:43
Copy link
Owner Author

shivasurya commented Jan 10, 2026

Merge activity

  • Jan 10, 4:45 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 10, 4:48 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jan 10, 4:49 AM UTC: @shivasurya merged this pull request with Graphite.

@shivasurya shivasurya changed the base branch from shiva/mcp-test-infrastructure to graphite-base/456 January 10, 2026 04:46
@shivasurya shivasurya changed the base branch from graphite-base/456 to main January 10, 2026 04:47
Implement comprehensive error handling:
- errors.go: Standard and custom error codes
- errors_test.go: Full test coverage

Error codes:
- -32700: Parse error
- -32600: Invalid Request
- -32601: Method not found
- -32602: Invalid params
- -32603: Internal error
- -32001: Symbol not found (with suggestions)
- -32002: Index not ready
- -32003: Query timeout

Features:
- Parameter validation helpers (ValidateStringParam, ValidateIntParam)
- Structured error responses with data field
- Tool error format with code and details
- Request validation (JSONRPC version, method required)

Coverage: errors.go 100%, total 91.6%

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@shivasurya shivasurya force-pushed the shiva/mcp-error-handling branch from b265133 to c59df07 Compare January 10, 2026 04:48
@shivasurya shivasurya merged commit 37e4822 into main Jan 10, 2026
3 checks passed
@shivasurya shivasurya deleted the shiva/mcp-error-handling branch January 10, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants