mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
provide context for errors to help debugging
This commit is contained in:
parent
fa9e6ddcd5
commit
3a2450cb23
1 changed files with 4 additions and 1 deletions
|
@ -4,6 +4,7 @@ use crate::storage::{Operation, Storage, TaskMap};
|
||||||
use crate::task::{Status, Task};
|
use crate::task::{Status, Task};
|
||||||
use crate::taskdb::TaskDb;
|
use crate::taskdb::TaskDb;
|
||||||
use crate::workingset::WorkingSet;
|
use crate::workingset::WorkingSet;
|
||||||
|
use anyhow::Context;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use log::trace;
|
use log::trace;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
@ -123,8 +124,10 @@ impl Replica {
|
||||||
/// this occurs, but without renumbering, so any newly-pending tasks should appear in
|
/// this occurs, but without renumbering, so any newly-pending tasks should appear in
|
||||||
/// the working set.
|
/// the working set.
|
||||||
pub fn sync(&mut self, server: &mut Box<dyn Server>) -> anyhow::Result<()> {
|
pub fn sync(&mut self, server: &mut Box<dyn Server>) -> anyhow::Result<()> {
|
||||||
self.taskdb.sync(server)?;
|
self.taskdb.sync(server).context("Failed to synchronize")?;
|
||||||
self.rebuild_working_set(false)
|
self.rebuild_working_set(false)
|
||||||
|
.context("Failed to rebuild working set after sync")?;
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Rebuild this replica's working set, based on whether tasks are pending or not. If
|
/// Rebuild this replica's working set, based on whether tasks are pending or not. If
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue