ricecoder_generation/
error.rs1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum GenerationError {
8 #[error("Template not found: {0}")]
10 TemplateNotFound(String),
11
12 #[error("Missing required placeholder: {0}")]
14 MissingPlaceholder(String),
15
16 #[error("Invalid template syntax at line {line}: {message}")]
18 InvalidSyntax {
19 line: usize,
21 message: String,
23 },
24
25 #[error("Render error: {0}")]
27 RenderError(String),
28
29 #[error("Validation failed: {0}")]
31 ValidationFailed(String),
32
33 #[error("IO error: {0}")]
35 IoError(#[from] std::io::Error),
36
37 #[error("Serialization error: {0}")]
39 SerializationError(#[from] serde_json::Error),
40
41 #[error("Spec error: {0}")]
43 SpecError(String),
44
45 #[error("Prompt error: {0}")]
47 PromptError(String),
48
49 #[error("Generation failed: {0}")]
51 GenerationFailed(String),
52
53 #[error("Validation error in {file}:{line}: {message}")]
55 ValidationError {
56 file: String,
58 line: usize,
60 message: String,
62 },
63
64 #[error("Linting error: {0}")]
66 LintingError(String),
67
68 #[error("Type checking error: {0}")]
70 TypeCheckingError(String),
71
72 #[error("Syntax error: {0}")]
74 SyntaxError(String),
75
76 #[error("Write failed: {0}")]
78 WriteFailed(String),
79
80 #[error("Rollback failed: {0}")]
82 RollbackFailed(String),
83}