Skip to main content

floe_core/
errors.rs

1use crate::log::emit_log;
2
3#[derive(Debug, thiserror::Error)]
4#[error("{0}")]
5pub struct ConfigError(pub String);
6
7#[derive(Debug, thiserror::Error)]
8#[error("{0}")]
9pub struct RunError(pub String);
10
11#[derive(Debug, thiserror::Error)]
12#[error("{0}")]
13pub struct StorageError(pub String);
14
15#[derive(Debug, thiserror::Error)]
16#[error("{0}")]
17pub struct IoError(pub String);
18
19pub fn emit(
20    run_id: &str,
21    entity: Option<&str>,
22    input: Option<&str>,
23    code: Option<&str>,
24    message: &str,
25) {
26    emit_log("error", run_id, entity, input, code, message);
27}