orion_error/core/
reason.rs1pub trait ErrorCode {
8 fn error_code(&self) -> i32 {
9 500
10 }
11}
12
13#[derive(Debug, Clone, Copy, PartialEq, Eq)]
14#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
15pub enum ErrorCategory {
16 Conf,
17 Biz,
18 Logic,
19 Sys,
20}
21
22impl ErrorCategory {
23 pub fn as_str(self) -> &'static str {
24 match self {
25 Self::Conf => "conf",
26 Self::Biz => "biz",
27 Self::Logic => "logic",
28 Self::Sys => "sys",
29 }
30 }
31}
32
33pub trait ErrorIdentityProvider {
34 fn stable_code(&self) -> &'static str;
35
36 fn error_category(&self) -> ErrorCategory;
37}