Skip to main content

systemprompt_content/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum ContentError {
5    #[error("Database must be PostgreSQL")]
6    DatabaseNotPostgres,
7
8    #[error("Database error: {0}")]
9    Database(#[from] sqlx::Error),
10
11    #[error("Content not found: {0}")]
12    ContentNotFound(String),
13
14    #[error("Link not found: {0}")]
15    LinkNotFound(String),
16
17    #[error("Invalid request: {0}")]
18    InvalidRequest(String),
19
20    #[error("Serialization error: {0}")]
21    Serialization(#[from] serde_json::Error),
22
23    #[error("Validation error: {0}")]
24    Validation(String),
25
26    #[error("Parse error: {0}")]
27    Parse(String),
28
29    #[error("IO error: {0}")]
30    Io(#[from] std::io::Error),
31
32    #[error("YAML parse error: {0}")]
33    Yaml(#[from] serde_yaml::Error),
34}