pub enum PdfConvertError {
IoError {
context: String,
source: Error,
},
ApiError {
status_code: Option<u16>,
message: String,
source: Option<Error>,
},
ParseError {
target: String,
message: String,
},
ValidationError {
parameter: String,
reason: String,
},
EnvError {
var_name: String,
message: String,
},
OperationError {
context: String,
message: String,
},
}Variants§
Implementations§
Source§impl PdfConvertError
impl PdfConvertError
pub fn io_error(context: impl Into<String>, source: Error) -> Self
pub fn api_error(status_code: Option<u16>, message: impl Into<String>) -> Self
pub fn parse_error( target: impl Into<String>, message: impl Into<String>, ) -> Self
pub fn validation_error( parameter: impl Into<String>, reason: impl Into<String>, ) -> Self
pub fn env_error( var_name: impl Into<String>, message: impl Into<String>, ) -> Self
pub fn operation_error( context: impl Into<String>, message: impl Into<String>, ) -> Self
pub fn api_task_failed( status: impl Into<String>, details: impl Into<String>, ) -> Self
Sourcepub fn status_code(&self) -> Option<u16>
pub fn status_code(&self) -> Option<u16>
Structured HTTP status for PdfConvertError::ApiError (issue #176).
Prefers the stored status_code (populated by api_error,
handle_response, and From<reqwest::Error>), then falls back to the
wrapped reqwest::Error::status(). Returns None for non-API variants
and for transport errors without an HTTP status (DNS, connect,
timeout). UUID hex fragments such as 401de82e never yield a status;
only a real HTTP status counts.
Sourcepub fn api_message(&self) -> Option<&str>
pub fn api_message(&self) -> Option<&str>
Borrowed message for PdfConvertError::ApiError, if present.
Lets callers read the human-readable detail without parsing
Display; returns None for non-API variants.
Sourcepub fn reqwest_source(&self) -> Option<&Error>
pub fn reqwest_source(&self) -> Option<&Error>
Typed reqwest cause for PdfConvertError::ApiError, if present.
Useful when callers need more than the status (e.g. timeout vs.
status errors) without downcasting via std::error::Error::source.
Trait Implementations§
Source§impl Debug for PdfConvertError
impl Debug for PdfConvertError
Source§impl Display for PdfConvertError
impl Display for PdfConvertError
Source§impl Error for PdfConvertError
impl Error for PdfConvertError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()