1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum MiniChatModelPolicyPluginError {
6 #[error("policy not found for the given tenant/version")]
7 NotFound,
8
9 #[error("internal policy plugin error: {0}")]
10 Internal(String),
11}
12
13#[derive(Debug, Error)]
18pub enum MiniChatAuditPluginError {
19 #[error("transient audit plugin error: {0}")]
21 Transient(String),
22
23 #[error("permanent audit plugin error: {0}")]
25 Permanent(String),
26}
27
28impl MiniChatAuditPluginError {
29 #[must_use]
30 pub fn is_transient(&self) -> bool {
31 matches!(self, Self::Transient(_))
32 }
33
34 #[must_use]
35 pub fn is_permanent(&self) -> bool {
36 matches!(self, Self::Permanent(_))
37 }
38}
39
40#[derive(Debug, Error)]
42pub enum PublishError {
43 #[error("transient publish error: {0}")]
45 Transient(String),
46
47 #[error("permanent publish error: {0}")]
49 Permanent(String),
50}
51
52impl PublishError {
53 #[must_use]
54 pub fn is_transient(&self) -> bool {
55 matches!(self, Self::Transient(_))
56 }
57
58 #[must_use]
59 pub fn is_permanent(&self) -> bool {
60 matches!(self, Self::Permanent(_))
61 }
62}