1
2
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum SolifyError {
7 #[error("IDL file not found: {0}")]
8 IdlNotFound(String),
9
10 #[error("Failed to parse IDL: {0}")]
11 IdlParseFailed(String),
12
13 #[error("Invalid instruction order: {0}")]
14 InvalidInstructionOrder(String),
15
16 #[error("Circular dependency detected")]
17 CircularDependency,
18
19 #[error("Account not found: {0}")]
20 AccountNotFound(String),
21
22 #[error("Instruction not found: {0}")]
23 InstructionNotFound(String),
24
25 #[error("IO error: {0}")]
26 IoError(#[from] std::io::Error),
27
28 #[error("Serialization error: {0}")]
29 SerializationError(String),
30
31 #[error("RPC error: {0}")]
32 RpcError(String),
33
34 #[error("Transaction error: {0}")]
35 TransactionError(String),
36
37 #[error("Template rendering error: {0}")]
38 TemplateError(String),
39
40 #[error("Unknown error: {0}")]
41 Unknown(String),
42
43 #[error("Dependency analysis failed: {0}")]
44 DependencyAnalysisFailed(String),
45
46 #[error("Invalid setup requirement")]
47 InvalidSetupRequirement,
48
49 #[error("Invalid PDA initialization")]
50 InvalidPdaInitialization,
51
52 #[error("Invalid test case")]
53 InvalidTestCase,
54
55
56}
57
58pub type Result<T> = std::result::Result<T, SolifyError>;