WIP add thiserror, anyhow

This commit is contained in:
Dominik Werder
2023-03-31 10:22:46 +02:00
parent a2e17848ba
commit 7c9085fe5b
9 changed files with 1185 additions and 488 deletions
+4 -2
View File
@@ -13,7 +13,9 @@ use bytes::Bytes;
use chrono::DateTime;
use chrono::TimeZone;
use chrono::Utc;
use err::anyhow;
use err::Error;
use err::Res2;
use futures_util::Stream;
use futures_util::StreamExt;
use range::evrange::NanoRange;
@@ -2279,9 +2281,9 @@ pub struct ChConf {
}
impl ChConf {
pub fn try_series(&self) -> Result<u64, Error> {
pub fn try_series(&self) -> Res2<u64> {
self.series
.ok_or_else(|| Error::with_msg_no_trace("ChConf without SeriesId"))
.ok_or_else(|| anyhow::anyhow!("ChConf without SeriesId {self:?}"))
}
}