{"record":{"id":"c64ba7e6267523c6","repo":"BoundaryML/baml","slug":"request-not-supported-0","errorCode":null,"errorMessage":"Request not supported: {0}","messagePattern":"Request not supported: (.+?)","errorType":"exception","errorClass":"LspError","httpStatus":null,"severity":"warning","filePath":"baml_language/crates/baml_lsp/src/error.rs","lineNumber":17,"sourceCode":"//! The one LSP error type and its JSON-RPC code table.\n\nuse std::path::PathBuf;\n\n/// Every failure a request or notification handler can report.\n///\n/// Serialized to the wire exclusively through [`LspError::to_response_error`];\n/// the legacy `-32001 UnknownErrorCode` is never emitted.\n#[derive(Debug, thiserror::Error)]\npub enum LspError {\n    #[error(\"{0}\")]\n    NotificationExtractError(lsp_server::ExtractError<lsp_server::Notification>),\n    #[error(\"Notification not supported: {0}\")]\n    NotificationNotSupported(String),\n    #[error(\"{0}\")]\n    RequestExtractError(lsp_server::ExtractError<lsp_server::Request>),\n    #[error(\"Request not supported: {0}\")]\n    RequestNotSupported(String),\n    #[error(\"Failed to serialize request result: {0}\")]\n    RequestSerializeError(serde_json::Error),\n    /// The client's sink is gone; nothing more can be delivered.\n    #[error(\"Client closed\")]\n    ClientClosed,\n    /// Bounded transport backpressure (LSP `RequestFailed`, `-32803`).\n    #[error(\"LSP outbound sink is saturated\")]\n    OutboundSaturated,\n    /// A frame larger than the transport limit (LSP `RequestFailed`,\n    /// `-32803`).\n    #[error(\"LSP outbound frame exceeds the transport limit\")]\n    OutboundOversized,\n    #[error(\"Invalid command arguments for command: {command}: {message}\")]\n    InvalidCommandArguments { command: String, message: String },\n    #[error(\"File not found: {}\", .0.display())]\n    FileNotFound(PathBuf),\n    #[error(\"Path is invalid: {}: {message}\", path.display())]","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_lsp/src/error.rs#L1-L35","documentation":"LspError::RequestNotSupported is produced when a request method arrives that the server does not implement. thiserror formats it as 'Request not supported: {method}'. The server converts it to a response error rather than emitting the legacy UnknownErrorCode.","triggerScenarios":"A client issues a request (e.g. textDocument/formatting, codeAction) that the server's dispatch table lacks; a capability-related request sent despite the server not advertising it.","commonSituations":"Newer editor features probing methods the server predates; clients not honoring serverInfo/capabilities; misconfigured clients calling custom methods.","solutions":["Verify via initialize capabilities that the server actually supports the requested method","Update the server implementation or use a client/server pair with matching feature sets","Handle the error on the client side and degrade gracefully (MethodNotFound -32601 semantics)"],"exampleFix":"// before\nclient.sendRequest(method);\n// after\nif (serverCapabilities[capability]) client.sendRequest(method);\nelse console.warn(`server lacks ${capability}; skipping`);","handlingStrategy":"type-guard","validationCode":"// client-side: check capabilities before issuing the request\nif (!capabilities.documentFormattingProvider) {\n  console.warn('server does not support textDocument/formatting');\n}","typeGuard":"fn is_unsupported_request(e: &LspError) -> Option<&str> {\n    if let LspError::RequestNotSupported(m) = e { Some(m) } else { None }\n}","tryCatchPattern":"// client-side\ntry { await client.request(method, params); }\ncatch (e) { if (isMethodNotFound(e)) degradeGracefully(); else throw e; }","preventionTips":["Gate client features on the server's initialize-result capabilities","Update server/client pairs together when adding new LSP methods"],"tags":["lsp","unsupported-method","rust"],"backgroundTag":"operation-not-supported","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}