///|
/// Errors raised by the moonllm client.
pub(all) suberror LLMError {
/// The HTTP request failed at the transport layer (connection, TLS, timeout).
Transport(String)
/// The server returned a non-2xx status. Carries the status code and body.
ApiError(code~ : Int, message~ : String)
/// The response body could not be parsed as the expected shape.
Decode(String)
/// A streaming response ended or framed unexpectedly.
Stream(String)
} derive(Debug)
///|
pub fn LLMError::to_string(self : LLMError) -> String {
match self {
Transport(m) => "transport error: " + m
ApiError(code~, message~) => "api error \{code}: \{message}"
Decode(m) => "decode error: " + m
Stream(m) => "stream error: " + m
}
}