marine_it_parser/
errors.rs1use marine_module_interface::interface::InterfaceError;
18use marine_module_interface::it_interface::ITInterfaceError;
19
20use wasmer_it::decoders::wat::Error as WATError;
21use thiserror::Error as ThisError;
22
23use std::io::Error as IOError;
24
25#[derive(Debug, ThisError)]
26pub enum ITParserError {
27 #[error("the module doesn't contain IT section")]
29 NoITSection,
30
31 #[error("the module contains multiple IT sections that is unsupported")]
33 MultipleITSections,
34
35 #[error("IT section is corrupted: IT section remainder isn't empty")]
37 ITRemainderNotEmpty,
38
39 #[error(
41 "IT section is corrupted: {0}.\
42 \nProbably the module was compiled with an old version of marine cli, please try to update and recompile.\
43 \nTo update marine run: cargo install marine --force"
44 )]
45 CorruptedITSection(nom::Err<(Vec<u8>, nom::error::ErrorKind)>),
46
47 #[error("0")]
49 IncorrectITFormat(String), #[error(transparent)]
53 ModuleInterfaceError(#[from] InterfaceError),
54
55 #[error(transparent)]
57 ModuleITInterfaceError(#[from] ITInterfaceError),
58
59 #[error("provided file with IT definitions is corrupted: {0}")]
61 CorruptedITFile(#[from] WATError),
62
63 #[error("provided Wasm file is corrupted: {0}")]
65 CorruptedWasmFile(anyhow::Error),
66
67 #[error("Convertation Wast to AST failed with: {0}")]
69 AstToBytesError(#[from] IOError),
70
71 #[error("Emitting resulted Wasm file failed with: {0}")]
73 WasmEmitError(anyhow::Error),
74}