Skip to content

Commit a3102ff

Browse files
fix: formatting of Display for TrapError
Signed-off-by: Florian Hartung <florian.hartung@dlr.de>
1 parent 8d2982c commit a3102ff

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/execution/error.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub enum RuntimeError {
5252
impl Display for RuntimeError {
5353
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
5454
match self {
55-
RuntimeError::Trap(trap_error) => write!(f, "{trap_error}"),
55+
RuntimeError::Trap(trap_error) => write!(f, "Execution trapped: {trap_error}"),
5656
RuntimeError::FunctionNotFound => f.write_str("Function not found"),
5757
RuntimeError::ModuleNotFound => f.write_str("No such module exists"),
5858
RuntimeError::ResumableNotFound => f.write_str("No such resumable exists"),
@@ -155,9 +155,7 @@ impl Display for TrapError {
155155
TrapError::TableAccessOutOfBounds => {
156156
f.write_str("Indirect call: table index out of bounds")
157157
}
158-
TrapError::ReachedUnreachable => {
159-
f.write_str("an unreachable statement was reached, triggered a trap")
160-
}
158+
TrapError::ReachedUnreachable => f.write_str("An unreachable statement was reached"),
161159
}
162160
}
163161
}

0 commit comments

Comments
 (0)