summaryrefslogtreecommitdiffstats
path: root/third_party/rust/lucet-module-wasmsbx/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/lucet-module-wasmsbx/src/error.rs')
-rw-r--r--third_party/rust/lucet-module-wasmsbx/src/error.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/third_party/rust/lucet-module-wasmsbx/src/error.rs b/third_party/rust/lucet-module-wasmsbx/src/error.rs
new file mode 100644
index 0000000000..a19ec8a334
--- /dev/null
+++ b/third_party/rust/lucet-module-wasmsbx/src/error.rs
@@ -0,0 +1,17 @@
+use failure::Fail;
+
+/// Module data (de)serialization errors.
+#[derive(Debug, Fail)]
+pub enum Error {
+ #[fail(display = "Sparse data contained a page with length other than 4096")]
+ IncorrectPageSize,
+ #[fail(display = "Deserialization error: {}", _0)]
+ DeserializationError(#[cause] bincode::Error),
+ #[fail(display = "Serialization error: {}", _0)]
+ SerializationError(#[cause] bincode::Error),
+ #[cfg(feature = "signature_checking")]
+ #[fail(display = "Module signature error: {}", _0)]
+ ModuleSignatureError(#[cause] minisign::PError),
+ #[fail(display = "I/O error: {}", _0)]
+ IOError(#[cause] std::io::Error),
+}