Skip to main content

varpulis_runtime/engine/
error.rs

1//! Typed error hierarchy for the Varpulis engine.
2
3#[cfg(feature = "async-runtime")]
4use varpulis_connectors::SinkError;
5
6#[cfg(feature = "async-runtime")]
7use crate::enrichment::EnrichmentError;
8use crate::persistence::StoreError;
9
10/// Top-level error type returned by engine public methods.
11#[derive(Debug, thiserror::Error)]
12pub enum EngineError {
13    /// Compilation or program-loading error (bad VPL, missing streams, etc.)
14    #[error("compilation error: {0}")]
15    Compilation(String),
16
17    /// Referenced stream does not exist.
18    #[error("stream not found: {0}")]
19    StreamNotFound(String),
20
21    /// Sink I/O or protocol error (async-runtime only).
22    #[cfg(feature = "async-runtime")]
23    #[error("sink error: {0}")]
24    Sink(#[from] SinkError),
25
26    /// Enrichment lookup error (async-runtime only).
27    #[cfg(feature = "async-runtime")]
28    #[error("enrichment error: {0}")]
29    Enrichment(#[from] EnrichmentError),
30
31    /// State-store / persistence error.
32    #[error("store error: {0}")]
33    Store(#[from] StoreError),
34
35    /// Runtime pipeline error (evaluation, pattern matching, etc.)
36    #[error("pipeline error: {0}")]
37    Pipeline(String),
38}