add error handling for tasks
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use crate::util::err_to_tcstring;
|
||||
use crate::{result::TCResult, status::TCStatus, string::TCString, task::TCTask, uuid::TCUuid};
|
||||
use taskchampion::{Replica, StorageConfig, Uuid};
|
||||
|
||||
@@ -75,10 +76,6 @@ impl From<Replica> for TCReplica {
|
||||
}
|
||||
}
|
||||
|
||||
fn err_to_tcstring(e: impl std::string::ToString) -> TCString<'static> {
|
||||
TCString::from(e.to_string())
|
||||
}
|
||||
|
||||
/// Utility function to allow using `?` notation to return an error value. This makes
|
||||
/// a mutable borrow, because most Replica methods require a `&mut`.
|
||||
fn wrap<'a, T, F>(rep: *mut TCReplica, f: F, err_value: T) -> T
|
||||
|
||||
Reference in New Issue
Block a user