Quality: String-based error handling — should use typed errors #95

Open
opened 2026-05-11 13:48:54 +00:00 by thabeta · 0 comments
Owner

Severity: Low

Location

Multiple locations — mcp.rs, chat.rs, router.rs

Finding

Errors are frequently passed as String or anyhow::Error without structured error types:

pub enum McpError {
    SpawnError(String),
    IoError(String),
    ParseError(String),
    Timeout(String),
}```

## Recommendation
- Use typed errors with structured data (not String)
- Implement `std::error::Error` for all error types
- Add error codes for API responses
## Severity: Low ## Location Multiple locations — `mcp.rs`, `chat.rs`, `router.rs` ## Finding Errors are frequently passed as `String` or `anyhow::Error` without structured error types: ```rust pub enum McpError { SpawnError(String), IoError(String), ParseError(String), Timeout(String), }``` ## Recommendation - Use typed errors with structured data (not String) - Implement `std::error::Error` for all error types - Add error codes for API responses
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_aibroker#95
No description provided.