systemprompt_runtime/
error.rs1use systemprompt_analytics::AnalyticsError;
15use systemprompt_config::{ConfigError as ProfileConfigError, ProfileBootstrapError};
16use systemprompt_database::RepositoryError;
17use systemprompt_extension::LoaderError;
18use systemprompt_files::FilesError;
19use systemprompt_models::errors::ConfigError as ModelConfigError;
20use systemprompt_models::paths::PathError;
21use systemprompt_users::UserError;
22use thiserror::Error;
23
24pub type RuntimeResult<T> = Result<T, RuntimeError>;
25
26#[derive(Debug, Error)]
27pub enum RuntimeError {
28 #[error(transparent)]
29 Profile(#[from] ProfileConfigError),
30
31 #[error(transparent)]
32 ProfileBootstrap(#[from] ProfileBootstrapError),
33
34 #[error(transparent)]
35 Config(#[from] ModelConfigError),
36
37 #[error(transparent)]
38 Paths(#[from] PathError),
39
40 #[error(transparent)]
41 Files(#[from] FilesError),
42
43 #[error(transparent)]
44 Users(#[from] UserError),
45
46 #[error(transparent)]
47 Repository(#[from] RepositoryError),
48
49 #[error(transparent)]
50 Analytics(#[from] AnalyticsError),
51
52 #[error(transparent)]
53 Loader(#[from] LoaderError),
54
55 #[error("DATABASE_URL is empty")]
56 EmptyDatabaseUrl,
57
58 #[error("Database not found at '{path}'. Run setup first")]
59 DatabaseNotFound { path: String },
60
61 #[error("Database path '{path}' exists but is not a file")]
62 DatabaseNotFile { path: String },
63
64 #[error("internal: {0}")]
65 Internal(String),
66}