Log errors as internal lines
This commit is contained in:
parent
5e52c6f2be
commit
dbb9d487b3
1 changed files with 8 additions and 2 deletions
|
|
@ -58,6 +58,7 @@ impl RunInProgress {
|
|||
.rev()
|
||||
.cloned()
|
||||
.collect();
|
||||
|
||||
UnfinishedRun {
|
||||
id: self.run.id.clone(),
|
||||
hash: self.run.hash.clone(),
|
||||
|
|
@ -67,6 +68,10 @@ impl RunInProgress {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn log_internal(&self, line: String) {
|
||||
self.output.lock().unwrap().push((Source::Internal, line));
|
||||
}
|
||||
|
||||
pub fn log_stdout(&self, line: String) {
|
||||
self.output.lock().unwrap().push((Source::Stdout, line));
|
||||
}
|
||||
|
|
@ -76,6 +81,7 @@ impl RunInProgress {
|
|||
}
|
||||
|
||||
pub async fn perform(&self, server: &Server) -> Option<FinishedRun> {
|
||||
// TODO Log system info
|
||||
// TODO Handle aborts
|
||||
let result = match &self.run.bench_method {
|
||||
BenchMethod::Internal => self.perform_internal(server),
|
||||
|
|
@ -87,8 +93,8 @@ impl RunInProgress {
|
|||
Ok(outcome) => outcome,
|
||||
Err(e) => {
|
||||
error!("Error during run for {}:\n{e:?}", server.name);
|
||||
self.log_stderr("Internal error:".to_string());
|
||||
self.log_stderr(format!("{e:?}"));
|
||||
self.log_internal("Internal error:".to_string());
|
||||
self.log_internal(format!("{e:?}"));
|
||||
Some(Finished {
|
||||
exit_code: -1,
|
||||
measurements: HashMap::new(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue