feat: complete Epic 1 production foundation
This commit is contained in:
@@ -13,14 +13,18 @@ pub enum RestAdapterError {
|
||||
InvalidHeaderName { header: String },
|
||||
#[error("invalid header value for {header}")]
|
||||
InvalidHeaderValue { header: String },
|
||||
#[error("outbound target is not allowed: {target}")]
|
||||
#[error("outbound target is not allowed")]
|
||||
TargetNotAllowed { target: String },
|
||||
#[error("outbound redirects are not allowed")]
|
||||
RedirectNotAllowed,
|
||||
#[error("rest request exceeds the configured limit of {limit_bytes} bytes")]
|
||||
RequestTooLarge { limit_bytes: usize },
|
||||
#[error("rest response exceeds the configured limit of {limit_bytes} bytes")]
|
||||
ResponseTooLarge { limit_bytes: usize },
|
||||
#[error("invalid outbound HTTP configuration: {details}")]
|
||||
InvalidConfiguration { details: String },
|
||||
#[error("request failed")]
|
||||
Transport(#[from] reqwest::Error),
|
||||
Transport { timeout: bool, connect: bool },
|
||||
#[error("sse collection window expired before stream completed")]
|
||||
WindowExpired,
|
||||
#[error("rest endpoint returned status {status}")]
|
||||
@@ -28,3 +32,12 @@ pub enum RestAdapterError {
|
||||
#[error("sse stream produced malformed event payload")]
|
||||
InvalidSseEvent,
|
||||
}
|
||||
|
||||
impl From<reqwest::Error> for RestAdapterError {
|
||||
fn from(value: reqwest::Error) -> Self {
|
||||
Self::Transport {
|
||||
timeout: value.is_timeout(),
|
||||
connect: value.is_connect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user