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 #[error("audit plugin timed out")]
30 PluginTimeout,
31}
32
33impl MiniChatAuditPluginError {
34 #[must_use]
35 pub fn is_transient(&self) -> bool {
36 matches!(self, Self::Transient(_) | Self::PluginTimeout)
37 }
38
39 #[must_use]
40 pub fn is_permanent(&self) -> bool {
41 matches!(self, Self::Permanent(_))
42 }
43}
44
45#[derive(Debug, Error)]
47pub enum PublishError {
48 #[error("transient publish error: {0}")]
50 Transient(String),
51
52 #[error("permanent publish error: {0}")]
54 Permanent(String),
55}
56
57impl PublishError {
58 #[must_use]
59 pub fn is_transient(&self) -> bool {
60 matches!(self, Self::Transient(_))
61 }
62
63 #[must_use]
64 pub fn is_permanent(&self) -> bool {
65 matches!(self, Self::Permanent(_))
66 }
67}