add context to some errors
This commit is contained in:
parent
5d56e8ecc0
commit
6daa02e8ad
1 changed files with 5 additions and 5 deletions
10
src/main.rs
10
src/main.rs
|
@ -487,15 +487,15 @@ fn main_auto(cli: CliAuto) -> Result<()> {
|
||||||
fn main_debug_output(cli: CliDebugOutput) -> Result<()> {
|
fn main_debug_output(cli: CliDebugOutput) -> Result<()> {
|
||||||
tracing_subscriber::fmt::init();
|
tracing_subscriber::fmt::init();
|
||||||
tracing::info!("Started tracing");
|
tracing::info!("Started tracing");
|
||||||
let config = std::fs::read_to_string(&cli.config)?;
|
let config = std::fs::read_to_string(&cli.config).context("Failed to read config file")?;
|
||||||
let config: Config = toml::from_str(&config)?;
|
let config: Config = toml::from_str(&config).context("Failed to parse config file")?;
|
||||||
|
|
||||||
let data = read_data_from_disk(&config)?;
|
let data = read_data_from_disk(&config).context("Failed to read data from disk")?;
|
||||||
|
|
||||||
let tz = &config.output.timezone;
|
let tz = &config.output.timezone;
|
||||||
let now = Utc::now().with_timezone(tz);
|
let now = Utc::now().with_timezone(tz);
|
||||||
let instances = process_data(&data, &config.output, now)?;
|
let instances = process_data(&data, &config.output, now).context("Failed to process data")?;
|
||||||
output_html(&config.output, &instances, now)?;
|
output_html(&config.output, &instances, now).context("Failed to output HTML")?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue