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(
15 feature = "serde",
16 derive(serde::Serialize, serde::Deserialize),
17 serde(rename_all = "lowercase")
18)]
19pub enum ErrorCategory {
20 Conf,
21 Biz,
22 Logic,
23 Sys,
24}
25
26impl ErrorCategory {
27 pub fn as_str(self) -> &'static str {
28 match self {
29 Self::Conf => "conf",
30 Self::Biz => "biz",
31 Self::Logic => "logic",
32 Self::Sys => "sys",
33 }
34 }
35}
36
37pub trait ErrorIdentityProvider {
38 fn stable_code(&self) -> &'static str;
39
40 fn error_category(&self) -> ErrorCategory;
41}