Get the message of the trap
(&self)
| 182 | impl 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 | |
| 205 | impl PartialEq for Trap { |