pub enum OrchestratorError {
ChannelClosed,
Inference(String),
ConfigError(String),
RateLimited {
retry_after_secs: u64,
},
BudgetExceeded {
spent: f64,
limit: f64,
},
AuthFailed(String),
InferenceTimeout {
timeout_secs: u64,
},
Other(String),
}Expand description
Orchestrator-specific errors.
All variants are non-panicking. Callers should match on the variant to decide whether to retry, shed, or propagate the error.
Variants§
ChannelClosed
A pipeline channel was closed before the request could be delivered.
This typically means a pipeline stage task has exited. The pipeline should be restarted. This error is not retryable within the same pipeline instance.
Inference(String)
An inference worker returned an error.
The inner string contains the provider error message. May be retryable depending on the underlying cause (transient network vs. invalid request).
ConfigError(String)
Pipeline or worker configuration is invalid.
Returned during startup validation. Not retryable without a config change.
RateLimited
Provider returned HTTP 429 — callers should back off for retry_after.
BudgetExceeded
Spending cap reached — no further inference allowed this session.
AuthFailed(String)
Provider rejected the request due to an authentication failure.
Returned when the provider returns HTTP 401 or 403. Not retryable without a credential rotation.
InferenceTimeout
The inference call exceeded the configured timeout and was cancelled.
The timeout_secs field reflects the timeout that was breached.
Retryable with a longer timeout or by shedding the request.
Other(String)
A catch-all error variant for errors that do not fit the other categories.
Implementations§
Source§impl OrchestratorError
impl OrchestratorError
Sourcepub fn error_kind(&self) -> &'static str
pub fn error_kind(&self) -> &'static str
Return a stable lowercase string identifying the error variant, suitable for use as a metric label or structured log field.
§Panics
This function does not panic.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Return true if retrying the request may succeed.
Transient errors (RateLimited, InferenceTimeout, Inference) are
retryable. Permanent errors (ConfigError, AuthFailed,
BudgetExceeded, ChannelClosed) are not.
§Panics
This function does not panic.
§Examples
use tokio_prompt_orchestrator::OrchestratorError;
assert!(OrchestratorError::RateLimited { retry_after_secs: 5 }.is_retryable());
assert!(!OrchestratorError::AuthFailed("bad key".into()).is_retryable());Trait Implementations§
Source§impl Debug for OrchestratorError
impl Debug for OrchestratorError
Source§impl Display for OrchestratorError
impl Display for OrchestratorError
Source§impl Error for OrchestratorError
impl Error for OrchestratorError
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for OrchestratorError
impl RefUnwindSafe for OrchestratorError
impl Send for OrchestratorError
impl Sync for OrchestratorError
impl Unpin for OrchestratorError
impl UnsafeUnpin for OrchestratorError
impl UnwindSafe for OrchestratorError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request