#[non_exhaustive]pub struct ErrorInfo {
pub code: String,
pub message: String,
pub path: Option<String>,
pub workflow_id: Option<String>,
pub task_id: Option<String>,
pub timestamp: Option<String>,
pub retry_attempted: Option<bool>,
pub retry_count: Option<u32>,
pub detail: Option<String>,
}Expand description
Structured error information for error tracking in messages
#[non_exhaustive]: construct through ErrorInfo::builder,
ErrorInfo::new, ErrorInfo::simple or ErrorInfo::simple_ref, which
are the documented paths. Field reads and .. patterns are unaffected, and
future field additions stay non-breaking.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.code: StringError code (e.g., “WORKFLOW_ERROR”, “TASK_ERROR”, “VALIDATION_ERROR”)
message: StringHuman-readable error message
path: Option<String>Optional path to the error location (e.g., “workflow.id”, “task.id”, “data.field”)
workflow_id: Option<String>ID of the workflow where the error occurred (if available)
task_id: Option<String>ID of the task where the error occurred (if available)
timestamp: Option<String>Timestamp when the error occurred
retry_attempted: Option<bool>Whether a retry was attempted
retry_count: Option<u32>Number of retries attempted
detail: Option<String>Operator-only detail lifted from DataflowError::Service.
Present on the persisted trace; a service must not surface it to an
untrusted caller. None for every engine-owned error, and omitted from
the serialized form when absent, so the JSON shape is unchanged unless a
Service error carried one.
Implementations§
Source§impl ErrorInfo
impl ErrorInfo
Sourcepub fn new(
workflow_id: Option<String>,
task_id: Option<String>,
error: DataflowError,
) -> Self
pub fn new( workflow_id: Option<String>, task_id: Option<String>, error: DataflowError, ) -> Self
Create a new error info entry with all fields
Sourcepub fn simple(code: String, message: String, path: Option<String>) -> Self
pub fn simple(code: String, message: String, path: Option<String>) -> Self
Create a simple error info with just code, message, and optional path
Sourcepub fn simple_ref(code: &str, message: &str, path: Option<&str>) -> Self
pub fn simple_ref(code: &str, message: &str, path: Option<&str>) -> Self
Create a simple error info from references (avoids cloning when possible)
Sourcepub fn with_retry(self) -> Self
pub fn with_retry(self) -> Self
Mark that a retry was attempted