/src/wasmer/lib/api/src/sys/errors.rs
Line | Count | Source (jump to first uncovered line) |
1 | | use crate::{LinkError, RuntimeError}; |
2 | | use wasmer_vm::Trap; |
3 | | |
4 | | impl From<wasmer_compiler::LinkError> for LinkError { |
5 | 0 | fn from(other: wasmer_compiler::LinkError) -> Self { |
6 | 0 | match other { |
7 | 0 | wasmer_compiler::LinkError::Import(namespace, name, error) => { |
8 | 0 | Self::Import(namespace, name, error) |
9 | | } |
10 | 0 | wasmer_compiler::LinkError::Trap(e) => Self::Trap(e.into()), |
11 | 0 | wasmer_compiler::LinkError::Resource(e) => Self::Resource(e), |
12 | | } |
13 | 0 | } Unexecuted instantiation: <wasmer::errors::LinkError as core::convert::From<wasmer_compiler::engine::error::LinkError>>::from Unexecuted instantiation: <wasmer::errors::LinkError as core::convert::From<wasmer_compiler::engine::error::LinkError>>::from |
14 | | } |
15 | | |
16 | | impl From<Trap> for RuntimeError { |
17 | 1.26k | fn from(trap: Trap) -> Self { |
18 | 1.26k | if trap.is::<Self>() { |
19 | 0 | return trap.downcast::<Self>().unwrap(); |
20 | 1.26k | } |
21 | 1.26k | let (wasm_trace, trap_code) = wasmer_compiler::get_trace_and_trapcode(&trap); |
22 | 1.26k | Self::new_from_source(trap, wasm_trace, trap_code) |
23 | 1.26k | } <wasmer::errors::RuntimeError as core::convert::From<wasmer_vm::trap::trap::Trap>>::from Line | Count | Source | 17 | 106 | fn from(trap: Trap) -> Self { | 18 | 106 | if trap.is::<Self>() { | 19 | 0 | return trap.downcast::<Self>().unwrap(); | 20 | 106 | } | 21 | 106 | let (wasm_trace, trap_code) = wasmer_compiler::get_trace_and_trapcode(&trap); | 22 | 106 | Self::new_from_source(trap, wasm_trace, trap_code) | 23 | 106 | } |
<wasmer::errors::RuntimeError as core::convert::From<wasmer_vm::trap::trap::Trap>>::from Line | Count | Source | 17 | 1.16k | fn from(trap: Trap) -> Self { | 18 | 1.16k | if trap.is::<Self>() { | 19 | 0 | return trap.downcast::<Self>().unwrap(); | 20 | 1.16k | } | 21 | 1.16k | let (wasm_trace, trap_code) = wasmer_compiler::get_trace_and_trapcode(&trap); | 22 | 1.16k | Self::new_from_source(trap, wasm_trace, trap_code) | 23 | 1.16k | } |
|
24 | | } |