udp: return errors from threads instead of panicking in some cases

This commit is contained in:
Joakim Frostegård 2024-01-29 22:17:30 +01:00
parent ae75d0cbe4
commit 1967d8aa3e
2 changed files with 10 additions and 16 deletions

View file

@ -60,13 +60,10 @@ pub fn run_statistics_worker(
let opt_tt = if config.statistics.write_html_to_file {
let mut tt = TinyTemplate::new();
if let Err(err) = tt.add_template(TEMPLATE_KEY, TEMPLATE_CONTENTS) {
::log::error!("Couldn't parse statistics html template: {:#}", err);
tt.add_template(TEMPLATE_KEY, TEMPLATE_CONTENTS)
.context("parse statistics html template")?;
None
} else {
Some(tt)
}
Some(tt)
} else {
None
};