MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / handleMalformedRequest

Method handleMalformedRequest

pkg/lsp/server.go:391–399  ·  view source on GitHub ↗

handleMalformedRequest attempts to extract an ID from malformed JSON and send error

(msg json.RawMessage, parseErr error)

Source from the content-addressed store, hash-verified

389
390// handleMalformedRequest attempts to extract an ID from malformed JSON and send error
391func (s *Server) handleMalformedRequest(msg json.RawMessage, parseErr error) {
392 // Try to extract just the ID from the malformed request
393 var partial struct {
394 ID interface{} `json:"id"`
395 }
396 if err := json.Unmarshal(msg, &partial); err == nil && partial.ID != nil {
397 s.sendError(partial.ID, ParseError, fmt.Sprintf("parse error: %v", parseErr))
398 }
399}
400
401// sendResult sends a successful response
402func (s *Server) sendResult(id interface{}, result interface{}) {

Callers 1

handleMessageMethod · 0.95

Calls 1

sendErrorMethod · 0.95

Tested by

no test coverage detected