Skip to content

Commit e075e90

Browse files
committed
Attempt to figure out how to emit MaxStepsReached error
1 parent 7267b01 commit e075e90

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

interp/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
113113
cli.max_steps.unwrap_or(u32::MAX),
114114
);
115115
let results = scheduler.execute_todos();
116+
scheduler.emit_all_diagnostics();
116117

117118
// Check whether the protocol was executed successfully
118119
for res in results {

protocols/src/errors.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,11 @@ impl DiagnosticEmitter {
373373
ExecutionError::Assertion(assert_err) => {
374374
Self::emit_assertion_error(handler, assert_err, transaction, symbol_table);
375375
}
376-
ExecutionError::MaxStepsReached(_) => {
377-
handler.emit_general_message(&format!("{error}"), Level::Error);
376+
ExecutionError::MaxStepsReached(max_steps) => {
377+
let thread_err = ThreadError::ExecutionLimitExceeded {
378+
max_steps: *max_steps as usize,
379+
};
380+
Self::emit_thread_error(handler, &thread_err, transaction, symbol_table);
378381
}
379382
}
380383
}

protocols/src/scheduler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl<'a> Scheduler<'a> {
349349
self.results.clone()
350350
}
351351

352-
fn emit_all_diagnostics(&mut self) {
352+
pub fn emit_all_diagnostics(&mut self) {
353353
// results and todos are parallel arrays, so we can use the same idx
354354
for (idx, result) in self.results.iter().enumerate() {
355355
if let Err(error) = result {

0 commit comments

Comments
 (0)