#[non_exhaustive]pub enum FaucetError {
Show 21 variants
Http(Error),
HttpStatus {
status: u16,
url: String,
body: String,
},
Json(Error),
JsonPath(String),
Auth(String),
RateLimited(Duration),
Url(String),
Transform(String),
Config(String),
Source(String),
Sink(String),
QualityFailure {
check: String,
message: String,
},
SchemaDrift {
columns: Vec<String>,
message: String,
},
PolicyViolation {
rule: String,
column: String,
message: String,
},
BudgetExceeded {
budget: String,
limit: u64,
actual: u64,
},
ProfileDrift {
columns: Vec<String>,
message: String,
},
ContractViolation {
version: String,
message: String,
},
State(String),
StateIncompatible {
key: String,
found: String,
expected: String,
},
CircuitOpen {
failures: u32,
cooldown: Duration,
},
Custom(Box<dyn Error + Send + Sync>),
}Expand description
All possible errors returned by faucet-stream.
#[non_exhaustive]: this enum demonstrably grows (QualityFailure,
CircuitOpen, SchemaDrift, ContractViolation all arrived post-1.0) and
it is the one type every third-party connector author touches. Marking it
keeps the next variant a minor release instead of a forced major for
faucet-core and everything downstream. Match with a _ arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Http(Error)
HttpStatus
An HTTP response with a non-success status code.
Contains the status code, URL, and (truncated) response body for
debugging. Whether this error is retriable depends on the status code
— see FaucetError::is_retriable.
Json(Error)
JsonPath(String)
Auth(String)
RateLimited(Duration)
The server responded with HTTP 429 Too Many Requests.
The inner value is the duration to wait before retrying,
parsed from the Retry-After response header (default: 60 s).
Url(String)
A URL could not be constructed or parsed.
Transform(String)
A record transform could not be compiled or applied (e.g. invalid regex).
Config(String)
A configuration or validation error (e.g. invalid endpoint, missing descriptor).
Source(String)
A source operation failed (e.g. database query error, file read error).
Sink(String)
A sink operation failed (e.g. BigQuery insert error).
QualityFailure
A data-quality check failed under an abort policy.
SchemaDrift
An incoming page’s shape diverged from the destination schema under an
on_drift: fail (or on_incompatible: fail) policy.
PolicyViolation
A data-flow policy rule was violated (#702): at run time a labelled value headed for a sink the rule does not allow, or a static check refused the run before it started.
BudgetExceeded
A run budget ceiling was crossed (#703): budget names the ceiling
(max_records / max_bytes / max_duration_secs), limit its value
and actual what the run reached or would have reached. A records /
bytes crossing refuses the whole page before it is written, so
the bookmark never advances past it; a duration crossing cancels the
run cooperatively at the next page boundary.
ProfileDrift
A run’s learned column profile drifted from its baseline under a
profiling.on_drift: fail policy (#708). Raised after the run’s data
is written: the failure marks the run, it does not undo it.
ContractViolation
A record breached the pipeline’s data contract under an
on_breach: fail policy. version is the contract version the
record was validated against.
State(String)
A state-store operation failed (read/write/delete of a replication bookmark, checkpoint, or other persisted pipeline state).
StateIncompatible
A stored state value this release or this source cannot read (#736): written by a newer faucet (a newer state format or bookmark schema) or by a different source. Raised before anything is read from the source, instead of guessing at the shape — which would silently re-sync or skip.
Fields
CircuitOpen
The resilience circuit breaker opened after repeated failures; the run
is aborted fast. cooldown is advisory for the orchestration layer
(e.g. faucet schedule delays re-entry by this duration).
Custom(Box<dyn Error + Send + Sync>)
A custom error from a third-party connector.
Use this to wrap your own error types without losing the error chain:
use faucet_core::FaucetError;
let err = FaucetError::Custom(Box::new(std::io::Error::new(
std::io::ErrorKind::Other,
"my connector failed",
)));Implementations§
Source§impl FaucetError
impl FaucetError
Sourcepub fn sink_status(
status: Option<u16>,
url: impl Into<String>,
message: String,
) -> FaucetError
pub fn sink_status( status: Option<u16>, url: impl Into<String>, message: String, ) -> FaucetError
A storage client’s failure, typed by its HTTP status when it has one:
a 429 or 5xx becomes HttpStatus (so the
resilience policy retries it) with message as the body; anything
else, including a failure with no response, is a
Sink error carrying message.
Sourcepub fn is_retriable(&self) -> bool
pub fn is_retriable(&self) -> bool
Whether this error is transient and the request should be retried.
Retriable errors:
- Network / connection errors (
Httpfrom reqwest) - Server errors (5xx status codes)
- Rate limiting (429 — handled separately with
Retry-After)
Non-retriable errors:
- Client errors (4xx except 429)
- JSON parse / JSONPath / auth / transform errors
Trait Implementations§
Source§impl Debug for FaucetError
impl Debug for FaucetError
Source§impl Display for FaucetError
impl Display for FaucetError
Source§impl Error for FaucetError
impl Error for FaucetError
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()
Source§impl From<Error> for FaucetError
impl From<Error> for FaucetError
Source§fn from(source: Error) -> FaucetError
fn from(source: Error) -> FaucetError
Source§impl From<Error> for FaucetError
impl From<Error> for FaucetError
Source§fn from(source: Error) -> FaucetError
fn from(source: Error) -> FaucetError
Auto Trait Implementations§
impl !RefUnwindSafe for FaucetError
impl !UnwindSafe for FaucetError
impl Freeze for FaucetError
impl Send for FaucetError
impl Sync for FaucetError
impl Unpin for FaucetError
impl UnsafeUnpin for FaucetError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more