| 529 | |
| 530 | #[derive(Debug, thiserror::Error)] |
| 531 | pub enum AiError { |
| 532 | #[error("no API key configured")] |
| 533 | NoApiKey, |
| 534 | |
| 535 | #[error("HTTP error: {0}")] |
| 536 | Http(String), |
| 537 | |
| 538 | #[error("API error (status {status}): {body}")] |
| 539 | ApiError { status: u16, body: String }, |
| 540 | |
| 541 | #[error("parse error: {0}")] |
| 542 | ParseError(String), |
| 543 | |
| 544 | #[error("empty response")] |
| 545 | EmptyResponse, |
| 546 | |
| 547 | #[error("runtime error: {0}")] |
| 548 | Runtime(String), |
| 549 | } |
| 550 | |
| 551 | #[cfg(test)] |
| 552 | mod tests { |
nothing calls this directly
no outgoing calls
no test coverage detected