hive_console_sdk/expressions/
error.rs1use vrl::prelude::ExpressionError;
2
3#[derive(Debug, thiserror::Error, Clone)]
5#[error("Failed to compile VRL expression '{expression}': {diagnostics}")]
6pub struct ExpressionCompileError {
7 pub expression: String,
8 pub diagnostics: String,
9}
10
11impl ExpressionCompileError {
12 pub fn new(expression: String, diagnostics: String) -> Self {
13 Self {
14 expression,
15 diagnostics,
16 }
17 }
18}
19
20#[derive(Debug, thiserror::Error, Clone)]
22#[error("Failed to execute VRL expression: {0}")]
23pub struct ExpressionExecutionError(#[from] pub ExpressionError);
24
25#[derive(Debug, thiserror::Error)]
27pub enum ProgramResolutionError<T: std::error::Error> {
28 #[error("Failed to execute expression: {0}")]
29 ExecutionFailed(#[source] ExpressionExecutionError),
30
31 #[error("Failed to convert result: {0}")]
32 ConversionFailed(#[source] T),
33}