Update deps, error type
This commit is contained in:
@@ -29,6 +29,7 @@ hex = "0.4.3"
|
||||
num-traits = "0.2.19"
|
||||
num-derive = "0.4.2"
|
||||
url = "2.5.4"
|
||||
autoerr = "0.0.5"
|
||||
tiny-keccak = { version = "2.0", features = ["sha3"] }
|
||||
daqbuf-err = { path = "../../../daqbuf-err" }
|
||||
taskrun = { path = "../taskrun" }
|
||||
|
||||
@@ -21,13 +21,14 @@ use std::time::SystemTime;
|
||||
use streams::tcprawclient::TEST_BACKEND;
|
||||
use taskrun::tokio;
|
||||
|
||||
#[derive(Debug, ThisError)]
|
||||
#[cstm(name = "ChannelConfig")]
|
||||
pub enum ConfigError {
|
||||
ParseError(ConfigParseError),
|
||||
NotFound,
|
||||
Error,
|
||||
}
|
||||
autoerr::create_error_v1!(
|
||||
name(ConfigError, "ChannelConfig"),
|
||||
enum variants {
|
||||
ParseError(ConfigParseError),
|
||||
NotFound,
|
||||
Error,
|
||||
},
|
||||
);
|
||||
|
||||
impl From<ConfigParseError> for ConfigError {
|
||||
fn from(value: ConfigParseError) -> Self {
|
||||
|
||||
@@ -91,7 +91,10 @@ async fn position_file(
|
||||
let gg = match gg {
|
||||
Ok(x) => x,
|
||||
Err(e) => {
|
||||
error!("can not position file for range {range:?} expand_right {expand_right:?} buflen {buflen}", buflen = buf.len());
|
||||
error!(
|
||||
"can not position file for range {range:?} expand_right {expand_right:?} buflen {}",
|
||||
buf.len()
|
||||
);
|
||||
return Err(e);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
use bytes::Buf;
|
||||
use bytes::BytesMut;
|
||||
use daqbuf_err as err;
|
||||
use err::thiserror;
|
||||
use err::Error;
|
||||
use err::ThisError;
|
||||
use futures_util::Stream;
|
||||
use futures_util::StreamExt;
|
||||
use items_0::streamitem::LogItem;
|
||||
@@ -23,8 +21,6 @@ use netpod::ScalarType;
|
||||
use netpod::SfChFetchInfo;
|
||||
use netpod::Shape;
|
||||
use parse::channelconfig::CompressionMethod;
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use std::collections::VecDeque;
|
||||
use std::io::Cursor;
|
||||
use std::path::PathBuf;
|
||||
@@ -38,26 +34,26 @@ use streams::needminbuffer::NeedMinBuffer;
|
||||
#[allow(unused)]
|
||||
macro_rules! trace_parse_buf { ($($arg:tt)*) => ( if false { trace!($($arg)*); }) }
|
||||
|
||||
#[derive(Debug, ThisError, Serialize, Deserialize)]
|
||||
#[cstm(name = "DatabufferDataParse")]
|
||||
pub enum DataParseError {
|
||||
DataFrameLengthMismatch,
|
||||
FileHeaderTooShort,
|
||||
BadVersionTag,
|
||||
HeaderTooLarge,
|
||||
Utf8Error,
|
||||
EventTooShort,
|
||||
#[error("EventTooLong({0}, {1})")]
|
||||
EventTooLong(Shape, u32),
|
||||
TooManyBeforeRange,
|
||||
EventWithOptional,
|
||||
BadTypeIndex,
|
||||
WaveShapeWithoutEventArray,
|
||||
ShapedWithoutDims,
|
||||
TooManyDims,
|
||||
UnknownCompression,
|
||||
BadCompresionBlockSize,
|
||||
}
|
||||
autoerr::create_error_v1!(
|
||||
name(DataParseError, "DatabufferDataParse"),
|
||||
enum variants {
|
||||
DataFrameLengthMismatch,
|
||||
FileHeaderTooShort,
|
||||
BadVersionTag,
|
||||
HeaderTooLarge,
|
||||
Utf8Error,
|
||||
EventTooShort,
|
||||
EventTooLong(Shape, u32),
|
||||
TooManyBeforeRange,
|
||||
EventWithOptional,
|
||||
BadTypeIndex,
|
||||
WaveShapeWithoutEventArray,
|
||||
ShapedWithoutDims,
|
||||
TooManyDims,
|
||||
UnknownCompression,
|
||||
BadCompresionBlockSize,
|
||||
},
|
||||
);
|
||||
|
||||
pub struct EventChunker {
|
||||
inp: NeedMinBuffer,
|
||||
|
||||
Reference in New Issue
Block a user