pub struct ErrorContext { /* private fields */ }Expand description
Where the engine mirrors failure records in the context, and how many it keeps.
After every recorded call that is not a Skip, each error record the call
added (the handler’s own and the engine’s) is appended at the path as
{"workflow_id", "task_id", "code", "status"}, status being the call’s
(500 for an Err), and the array is trimmed to the newest
limit. A call that adds no record writes nothing, so a
message whose calls all succeed has no key at the path, not []. As in
v3, every segment below the root names an object key: a non-array at the
path, or anything but an object above it, is replaced.
At run start the engine removes the path’s key: a message never brings records in.
use dataflow_rs::run::{EngineConfig, ErrorContext};
use dataflow_rs::ErrorKind;
let ec = ErrorContext::new("metadata.errors".parse()?, ErrorContext::DEFAULT_LIMIT)?;
assert_eq!(ec.limit(), 32);
let config = EngineConfig::default().error_context(ec);
assert!(config.error_context.is_some());
// The engine owns `metadata.progress`, and every slot below it.
let refused = ErrorContext::new("metadata.progress.errors".parse()?, 32).unwrap_err();
assert_eq!(*refused.kind(), ErrorKind::Config);Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub const DEFAULT_LIMIT: usize = 32
pub const DEFAULT_LIMIT: usize = 32
The records kept when a host names no limit: v3’s default.
Sourcepub fn new(path: Path, limit: usize) -> Result<Self>
pub fn new(path: Path, limit: usize) -> Result<Self>
The error context at path, keeping the newest limit records.
§Errors
ErrorKind::Config for a root (data, metadata or temp_data
itself); for a path at or below a metadata slot the engine owns
metadata.progress, which it writes after every call for
cross-workflow chaining, and the run’s stamps metadata.processed_at,
metadata.engine_version and metadata.channel; and for a limit of
0.
Trait Implementations§
Source§impl Clone for ErrorContext
impl Clone for ErrorContext
Source§impl Debug for ErrorContext
impl Debug for ErrorContext
impl Eq for ErrorContext
Source§impl PartialEq for ErrorContext
impl PartialEq for ErrorContext
impl StructuralPartialEq for ErrorContext
Auto Trait Implementations§
impl Freeze for ErrorContext
impl RefUnwindSafe for ErrorContext
impl Send for ErrorContext
impl Sync for ErrorContext
impl Unpin for ErrorContext
impl UnsafeUnpin for ErrorContext
impl UnwindSafe for ErrorContext
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.