Provide some debug info for if posting a status update fails

This commit is contained in:
Graham Christensen 2020-04-02 09:12:40 -04:00
parent 9548a495d5
commit 1c1ccc8c7e
No known key found for this signature in database
GPG key ID: FE918C3A98C1030F

View file

@ -221,16 +221,23 @@ impl<'a, E: stats::SysEvents + 'static> OneEval<'a, E> {
update_labels(&issue_ref, &[String::from("ofborg-internal-error")], &[]); update_labels(&issue_ref, &[String::from("ofborg-internal-error")], &[]);
} }
EvalWorkerError::EvalError(eval::Error::Fail(msg)) => { EvalWorkerError::EvalError(eval::Error::Fail(msg)) => {
self.update_status(msg, None, hubcaps::statuses::State::Failure) self.update_status(msg.clone(), None, hubcaps::statuses::State::Failure)
.expect("Failed to set status"); .unwrap_or_else(|e| {
panic!("Failed to set plain status: {}; e: {:#?}", msg, e);
});
} }
EvalWorkerError::EvalError(eval::Error::FailWithGist(msg, filename, content)) => { EvalWorkerError::EvalError(eval::Error::FailWithGist(msg, filename, content)) => {
self.update_status( self.update_status(
msg, msg.clone(),
self.make_gist(&filename, Some("".to_owned()), content), self.make_gist(&filename, Some("".to_owned()), content.clone()),
hubcaps::statuses::State::Failure, hubcaps::statuses::State::Failure,
) )
.expect("Failed to set status"); .unwrap_or_else(|e| {
panic!(
"Failed to set status with a gist: {}, {}, {}; e: {:#?}",
msg, filename, content, e
);
});
} }
} }