1use troupekit_core::error::CoreError;
2
3#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
7#[error("{file}: {field}: {message}")]
8pub struct PersonaError {
9 pub file: String,
10 pub field: String,
11 pub message: String,
12}
13
14impl PersonaError {
15 pub fn new(file: &str, field: &str, message: impl Into<String>) -> Self {
19 Self {
20 file: file.to_string(),
21 field: field.to_string(),
22 message: message.into(),
23 }
24 }
25}
26
27#[derive(Debug, Clone, PartialEq, thiserror::Error)]
31pub enum AgentError {
32 #[error(transparent)]
33 Persona(#[from] PersonaError),
34 #[error("persona not found: {0}")]
35 NotFound(String),
36 #[error("persona source: {0}")]
37 Source(String),
38 #[error("setup: {0}")]
39 Setup(String),
40 #[error("checkpoint: {0}")]
41 Checkpoint(String),
42 #[error(transparent)]
43 Store(#[from] CoreError),
44}