wp-error 0.10.0

Structured, domain-specific error types and robustness strategies extracted from WarpParse
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use derive_more::From;
use orion_error::{OrionError, StructError, UnifiedReason};
use serde::Serialize;

#[derive(Debug, Clone, PartialEq, Serialize, From, OrionError)]
pub enum KnowledgeReason {
    #[orion_error(identity = "biz.not_data", message = "not data")]
    NotData,
    #[orion_error(transparent)]
    Uvs(UnifiedReason),
}

pub type KnowledgeError = StructError<KnowledgeReason>;
pub type KnowledgeResult<T> = Result<T, StructError<KnowledgeReason>>;