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)]
15pub enum PublishError {
16 #[error("transient publish error: {0}")]
18 Transient(String),
19
20 #[error("permanent publish error: {0}")]
22 Permanent(String),
23}
24
25impl PublishError {
26 #[must_use]
27 pub fn is_transient(&self) -> bool {
28 matches!(self, Self::Transient(_))
29 }
30
31 #[must_use]
32 pub fn is_permanent(&self) -> bool {
33 matches!(self, Self::Permanent(_))
34 }
35}