nyquest_interface/error.rs
1//! Error types for nyquest HTTP operations.
2
3use thiserror::Error;
4
5/// Common error types that can occur in nyquest HTTP operations.
6#[derive(Debug, Error)]
7pub enum Error {
8 /// The provided URL is invalid.
9 #[error("Invalid URL")]
10 InvalidUrl,
11 /// An underlying I/O error occurred.
12 #[error("IO Error")]
13 Io(#[from] std::io::Error),
14 /// The response body exceeds the maximum allowed size.
15 #[error("Response body size exceeds max limit")]
16 ResponseTooLarge,
17 /// The request timed out before completion.
18 #[error("Request is not finished within timeout")]
19 RequestTimeout,
20}
21
22/// Result type for nyquest HTTP operations.
23pub type Result<T> = std::result::Result<T, Error>;