(error: McpOAuthError)
| 2707 | } |
| 2708 | |
| 2709 | fn mcp_error_to_api_error(error: McpOAuthError) -> ApiError { |
| 2710 | match error { |
| 2711 | McpOAuthError::ServerNotFound(name) => { |
| 2712 | ApiError::NotFound(format!("MCP server not found: {}", name)) |
| 2713 | } |
| 2714 | McpOAuthError::OAuthNotSupported(name) => { |
| 2715 | ApiError::BadRequest(format!("MCP server does not support OAuth: {}", name)) |
| 2716 | } |
| 2717 | McpOAuthError::OAuthInProgress => ApiError::BadRequest("OAuth already in progress".into()), |
| 2718 | McpOAuthError::OAuthFailed(message) => ApiError::BadRequest(message), |
| 2719 | McpOAuthError::RuntimeError(message) => ApiError::BadRequest(message), |
| 2720 | } |
| 2721 | } |
| 2722 | |
| 2723 | fn parse_runtime_from_request(config: McpConfigInput) -> Result<(McpRuntimeConfig, bool)> { |
| 2724 | let enabled = config.enabled.unwrap_or(true); |
nothing calls this directly
no outgoing calls
no test coverage detected