Expand description
Error types for the Deboa HTTP client.
This module contains the error types used throughout the Deboa HTTP client.
The main error type is DeboaError, which can represent various kinds of errors
that might occur during HTTP requests and responses.
§Error Types
DeboaError: The main error type that can represent any error that occurs in DeboaRequestError: Errors that occur while building or sending HTTP requestsResponseError: Errors that occur while processing HTTP responsesConnectionError: Errors that occur during network connectionsContentError: Errors related to content serialization/deserializationIoError: I/O related errors
§Examples
§Handling Errors
ⓘ
use deboa::{Deboa, request::get};
use deboa::errors::DeboaError;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut client = Deboa::default();
match get("https://example.com").and_then(|req| req.send_with(&mut client)) {
Ok(response) => {
// Handle successful response
},
Err(DeboaError::Connection(e)) => {
// Handle connection errors
eprintln!("Connection failed: {}", e);
},
Err(DeboaError::Request(e)) => {
// Handle request errors
eprintln!("Request failed: {}", e);
},
Err(e) => {
// Handle other errors
eprintln!("Error: {}", e);
}
}
Ok(())
}Enums§
- Connection
Error - Content
Error - Deboa
Error - The main error type for the Deboa HTTP client.
- IoError
- Request
Error - Response
Error