wasm_gc/
error.rs

1use std::error;
2use std::fmt;
3use parity_wasm::elements::Error as ParityWasmError;
4
5/// The error type for garbage collecting webassembly bytecode.
6#[derive(Debug)]
7pub struct Error(ParityWasmError);
8
9impl error::Error for Error {
10    fn description(&self) -> &str {
11        "webassembly garbage collection failed"
12    }
13}
14
15impl fmt::Display for Error {
16    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
17        write!(f, "{:?}", self.0)
18    }
19}
20
21pub fn from(parity: ParityWasmError) -> Error {
22    Error(parity)
23}