marine_test_macro_impl/
errors.rs1use marine_it_parser::ITParserError;
18use fluence_app_service::AppServiceError;
19use fluence_app_service::MarineError;
20
21use darling::Error as DarlingError;
22use syn::Error as SynError;
23use thiserror::Error as ThisError;
24
25use std::path::PathBuf;
26
27#[derive(Debug, ThisError)]
28pub enum TestGeneratorError {
29 #[error("Can't load Wasm module at {0} into Marine: {1}")]
30 ITParserError(PathBuf, ITParserError),
31
32 #[error("{0}")]
33 CorruptedITSection(#[from] CorruptedITSection),
34
35 #[error("{0}")]
36 SynError(#[from] SynError),
37
38 #[error("Can't load Wasm modules from the provided config at {0}: {1}")]
39 ConfigLoadError(PathBuf, AppServiceError),
40
41 #[error("Can't resolve module {0} path: {1}")]
42 ModuleResolveError(String, MarineError),
43
44 #[error("{0}")]
45 AttributesError(#[from] DarlingError),
46
47 #[error(
48 "neither modules_dir attribute specified nor service config contains modules_dir, please specify one of them"
49 )]
50 ModulesDirUnspecified,
51
52 #[error("a Wasm file compiled with newer version of sdk that supports multi-value")]
53 ManyFnOutputsUnsupported,
54
55 #[error("{0} is invalid UTF8 path")]
56 InvalidUTF8Path(PathBuf),
57
58 #[error(r#"a "self" argument found and it is not supported in test function"#)]
59 UnexpectedSelf,
60
61 #[error("Duplicate module: {0}")]
62 DuplicateModuleName(String),
63
64 #[error("No modules loaded for a service")]
65 NoModulesInService,
66
67 #[error("Multi-service variant must be applied to a mod or fn")]
68 ExpectedModOrFn,
69
70 #[error("Single-service variant must be applied to a fn")]
71 ExpectedFn,
72}
73
74#[derive(Debug, ThisError)]
75pub enum CorruptedITSection {
76 #[error("record with {0} is absent in embedded IT section")]
77 AbsentRecord(u64),
78}