worldinterface_connector/error.rs
1//! Error types for connector invocations and transform execution.
2
3/// Errors from connector invocations.
4#[derive(Debug, thiserror::Error)]
5pub enum ConnectorError {
6 /// Transient failure — the invocation can be retried.
7 /// Maps to AQ `HandlerOutput::RetryableFailure` in Sprint 4.
8 #[error("retryable error: {0}")]
9 Retryable(String),
10
11 /// Permanent failure — retrying will not help.
12 /// Maps to AQ `HandlerOutput::TerminalFailure` in Sprint 4.
13 #[error("terminal error: {0}")]
14 Terminal(String),
15
16 /// The invocation was cancelled via the cancellation token.
17 /// Maps to AQ `HandlerOutput::RetryableFailure` in Sprint 4.
18 #[error("operation cancelled")]
19 Cancelled,
20
21 /// The connector received parameters it cannot process.
22 /// Maps to AQ `HandlerOutput::TerminalFailure` in Sprint 4.
23 #[error("invalid parameters: {0}")]
24 InvalidParams(String),
25}
26
27/// Errors from transform execution.
28#[derive(Debug, thiserror::Error)]
29pub enum TransformError {
30 /// A referenced field path does not exist in the input.
31 #[error("field not found: {path}")]
32 FieldNotFound { path: String },
33
34 /// The input value is not the expected type for the transform.
35 #[error("type mismatch: expected {expected}, got {actual}")]
36 TypeMismatch { expected: String, actual: String },
37}