coda_pm/error.rs
1//! Error types for the prompt manager.
2
3use thiserror::Error;
4
5/// Errors that can occur when managing prompt templates.
6#[derive(Debug, Error)]
7#[non_exhaustive]
8pub enum PromptError {
9 /// The requested template was not found by name.
10 #[error("Template not found: {0}")]
11 TemplateNotFound(String),
12
13 /// An error occurred while rendering a template.
14 #[error("Template render error: {0}")]
15 RenderError(String),
16
17 /// The template content is invalid (e.g., syntax error).
18 #[error("Invalid template: {0}")]
19 InvalidTemplate(String),
20
21 /// An I/O error occurred while reading template files.
22 #[error("IO error: {0}")]
23 IoError(#[from] std::io::Error),
24}