Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Adding State Transition Error Logging. (#2425)
Browse files Browse the repository at this point in the history
* Adding State Transition Logging.

* Fix log call.

* Removing logging statement.

* Fix error! call.

* Adding error to error message.

* Make err var borrowed.

* Formatting.
  • Loading branch information
nharper285 authored Sep 21, 2022
1 parent 39c3736 commit 2f42cd7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/agent/onefuzz-task/src/tasks/generic/input_poller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,13 @@ impl<M> InputPoller<M> {

let result = self.try_trigger(state, event).await;

if result.is_err() {
if let Err(err) = &result {
// We must maintain a valid state, and we can logically recover from
// any failed action or invalid transition.
error!(
"State Transition Failed. Resetting state to 'Ready.' Error: {}",
err
);
self.state = Some(State::Ready);
}

Expand Down

0 comments on commit 2f42cd7

Please sign in to comment.