systemprompt_models/errors/
parse.rs1#[derive(Debug, Clone, thiserror::Error, PartialEq, Eq)]
7#[error("invalid {kind}: {value}")]
8pub struct ParseEnumError {
9 pub kind: &'static str,
10 pub value: String,
11}
12
13impl ParseEnumError {
14 #[must_use]
15 pub fn new(kind: &'static str, value: impl Into<String>) -> Self {
16 Self {
17 kind,
18 value: value.into(),
19 }
20 }
21}
22
23#[derive(Debug, Clone, Copy, thiserror::Error)]
24pub enum ConfigError {
25 #[error("Config not initialized. Call Config::init() first.")]
26 NotInitialized,
27
28 #[error("DATABASE_URL must be a PostgreSQL connection string (postgres:// or postgresql://)")]
29 InvalidPostgresUrl,
30}