Skip to content

Commit a18e8c1

Browse files
committed
fix: make HTTP server error type Send + Sync for proper test error handling
1 parent db4bfe9 commit a18e8c1

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

crates/codegraph-mcp/src/bin/codegraph-official.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ enum Commands {
5252
}
5353

5454
#[tokio::main]
55-
async fn main() -> Result<(), Box<dyn std::error::Error>> {
55+
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
5656
tracing_subscriber::fmt()
5757
.with_writer(std::io::stderr)
5858
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())

crates/codegraph-mcp/src/http_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use tracing::info;
1616
pub async fn start_http_server(
1717
server: CodeGraphMCPServer,
1818
config: HttpServerConfig,
19-
) -> Result<(), Box<dyn std::error::Error>> {
19+
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
2020
info!("Starting HTTP server at {}", config.bind_address());
2121

2222
// Create session manager for stateful HTTP connections

crates/codegraph-mcp/tests/http_server_integration.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ async fn test_http_server_health_check() {
2020
};
2121

2222
let server_handle = tokio::spawn(async move {
23-
let _ = start_http_server(server, config).await;
23+
if let Err(e) = start_http_server(server, config).await {
24+
eprintln!("Server error: {}", e);
25+
}
2426
});
2527

2628
// Wait for server to start
@@ -52,7 +54,9 @@ async fn test_http_mcp_initialize_request() {
5254
};
5355

5456
let server_handle = tokio::spawn(async move {
55-
let _ = start_http_server(server, config).await;
57+
if let Err(e) = start_http_server(server, config).await {
58+
eprintln!("Server error: {}", e);
59+
}
5660
});
5761

5862
sleep(Duration::from_millis(100)).await;

0 commit comments

Comments
 (0)