MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / message

Method message

crates/tinywasm/src/error.rs:184–202  ·  view source on GitHub ↗

Get the message of the trap

(&self)

Source from the content-addressed store, hash-verified

182impl Trap {
183 /// Get the message of the trap
184 pub fn message(&self) -> &'static str {
185 match self {
186 Self::Unreachable => "unreachable",
187 Self::MemoryOutOfBounds { .. } => "out of bounds memory access",
188 Self::TableOutOfBounds { .. } => "out of bounds table access",
189 Self::DivisionByZero => "integer divide by zero",
190 Self::InvalidConversionToInt => "invalid conversion to integer",
191 Self::IntegerOverflow => "integer overflow",
192 Self::CallStackOverflow => "call stack exhausted",
193 Self::ValueStackOverflow => "value stack exhausted",
194 Self::OutOfMemory => "out of memory",
195 Self::UndefinedElement { .. } => "undefined element",
196 Self::UninitializedElement { .. } => "uninitialized element",
197 Self::IndirectCallTypeMismatch { .. } => "indirect call type mismatch",
198 Self::HostFunction(_) => "host function trap",
199 Self::InvalidStore => "invalid store",
200 Self::Other(message) => message,
201 }
202 }
203}
204
205impl PartialEq for Trap {

Callers 3

fromMethod · 0.80
run_fileMethod · 0.80
eqMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected