#[non_exhaustive]pub enum SdkError {
Show 14 variants
Service {
service: ServiceError,
},
FlowAlreadyStarted {
service: ServiceError,
},
FlowClosing {
service: ServiceError,
},
FlowNotFound {
service: ServiceError,
},
FlowNotActiveOrNotFound {
service: ServiceError,
},
WorkerInvocation {
service: ServiceError,
worker: Box<WorkerError>,
},
RpcLockConflict {
service: ServiceError,
},
LongPollTimeout {
service: ServiceError,
},
ChannelMessageNotFound {
service: ServiceError,
},
RequestTimeout {
service: ServiceError,
},
FlowDefinition {
message: String,
},
InvalidArgument {
message: String,
},
ValueMapping {
message: String,
},
InvalidStepResult {
flow_type: String,
step_type: String,
detail: String,
},
}Expand description
Reports service, definition, value, handler, and Flow-completion failures.
Match specific variants when recovery differs. Self::service_error extracts common gRPC
metadata from every service-backed variant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Service
A general Dex service or transport call failed.
Fields
service: ServiceErrorStructured service failure.
FlowAlreadyStarted
Starting a Flow conflicted with an existing Flow ID.
Fields
service: ServiceErrorStructured start-operation failure.
FlowClosing
An update-class request arrived while Dex was closing the Flow.
Re-read the retained terminal Flow state before deciding what to do next. Match this variant instead of comparing service detail text:
fn should_reread_terminal_state(result: &SdkResult<()>) -> bool {
matches!(result, Err(SdkError::FlowClosing { .. }))
}Fields
service: ServiceErrorStructured rejected-operation failure, including the original transport cause.
FlowNotFound
An operation requiring an existing Flow targeted an unknown ID.
Fields
service: ServiceErrorStructured lookup failure.
FlowNotActiveOrNotFound
A Flow was not found or the operation could not use its closed execution.
RPC calls also use this variant for missing query-only targets. A query-only RPC without locks, transactionality, durable effects, or Server-forced Update routing can read a retained terminal execution. At that confirmed read boundary, treat this variant as not found without a lifecycle probe. Preserve other service and Worker failures.
For mutations and active-only RPCs, this variant does not distinguish missing from closed targets or prove that the requested action succeeded. Match it as follows:
fn report_unavailable(result: SdkResult<()>) -> SdkResult<()> {
match result {
Err(SdkError::FlowNotActiveOrNotFound { service }) => {
eprintln!("{} has no usable target", service.operation());
Err(SdkError::FlowNotActiveOrNotFound { service })
}
other => other,
}
}Fields
service: ServiceErrorStructured target failure, including the original transport cause.
WorkerInvocation
A Worker Step or RPC handler failed.
Fields
service: ServiceErrorOuter Dex service failure.
worker: Box<WorkerError>Original Worker-side failure metadata.
RpcLockConflict
A locking RPC could not acquire all requested Attribute locks.
Fields
service: ServiceErrorStructured aborted-operation failure.
LongPollTimeout
A long-poll timeout elapsed without indicating a Flow failure.
Fields
service: ServiceErrorStructured timeout failure.
ChannelMessageNotFound
A requested Channel message is no longer pending.
Fields
service: ServiceErrorStructured deletion failure.
RequestTimeout
A caller-defined request budget expired.
Fields
service: ServiceErrorStructured timeout failure.
FlowDefinition
A registered Flow, Step, RPC, or persistence definition is invalid.
InvalidArgument
An SDK method received an invalid argument.
ValueMapping
An application value could not be serialized or decoded.
InvalidStepResult
A Step returned a value that violates its handler contract.
Implementations§
Source§impl SdkError
impl SdkError
Sourcepub fn pull_registration_error(&self) -> Option<&PullRegistrationError>
pub fn pull_registration_error(&self) -> Option<&PullRegistrationError>
Returns the typed pull queue rejection when a permanent error leaves no registered stream.
Registration waiters and opt-in Worker shutdown return the existing Self::Service
variant. This accessor preserves its queue name and original gRPC status. Other errors
return None. See crate::PullRegistrationError for a complete inspection example.
Sourcepub fn service_error(&self) -> Option<&ServiceError>
pub fn service_error(&self) -> Option<&ServiceError>
Returns shared service metadata for service-backed variants.
Local definition, argument, mapping, and invalid-result errors return None.
Trait Implementations§
Source§impl Error for SdkError
impl Error for SdkError
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 !RefUnwindSafe for SdkError
impl !UnwindSafe for SdkError
impl Freeze for SdkError
impl Send for SdkError
impl Sync for SdkError
impl Unpin for SdkError
impl UnsafeUnpin for SdkError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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