Update deps, error type
This commit is contained in:
@@ -35,7 +35,7 @@ rand = "0.9.0"
|
||||
ciborium = "0.2.2"
|
||||
flate2 = "1"
|
||||
brotli = "8.0.1"
|
||||
autoerr = "0.0.3"
|
||||
autoerr = "0.0"
|
||||
daqbuf-err = { path = "../../../daqbuf-err" }
|
||||
netpod = { path = "../../../daqbuf-netpod", package = "daqbuf-netpod" }
|
||||
query = { path = "../../../daqbuf-query", package = "daqbuf-query" }
|
||||
|
||||
@@ -623,7 +623,7 @@ impl DataApiPython3DataStream {
|
||||
b.be[i1],
|
||||
b.scalar_types[i1],
|
||||
b.shapes[i1],
|
||||
b.comps[i1],
|
||||
b.comps[i1]
|
||||
);
|
||||
}
|
||||
// TODO emit warning when we use a different setting compared to channel config.
|
||||
|
||||
@@ -3,9 +3,7 @@ use async_channel::Receiver;
|
||||
use async_channel::Sender;
|
||||
use bytes::Bytes;
|
||||
use daqbuf_err as err;
|
||||
use err::thiserror;
|
||||
use err::PublicError;
|
||||
use err::ThisError;
|
||||
use err::ToPublicError;
|
||||
use futures_util::Stream;
|
||||
use futures_util::StreamExt;
|
||||
@@ -30,18 +28,17 @@ use std::task::Context;
|
||||
use std::task::Poll;
|
||||
use taskrun::tokio;
|
||||
|
||||
#[derive(Debug, ThisError)]
|
||||
#[cstm(name = "ChannelFindActive")]
|
||||
pub enum FindActiveError {
|
||||
HttpBadAccept,
|
||||
HttpBadUrl,
|
||||
#[error("Error({0})")]
|
||||
Error(Box<dyn ToPublicError>),
|
||||
#[error("UrlError({0})")]
|
||||
UrlError(#[from] url::ParseError),
|
||||
InternalError,
|
||||
IO(#[from] std::io::Error),
|
||||
}
|
||||
autoerr::create_error_v1!(
|
||||
name(FindActiveError, "ChannelFindActive"),
|
||||
enum variants {
|
||||
HttpBadAccept,
|
||||
HttpBadUrl,
|
||||
Error(Box<dyn ToPublicError>),
|
||||
UrlError(#[from] url::ParseError),
|
||||
InternalError,
|
||||
IO(#[from] std::io::Error),
|
||||
},
|
||||
);
|
||||
|
||||
impl ToPublicError for FindActiveError {
|
||||
fn to_public_error(&self) -> PublicError {
|
||||
|
||||
@@ -2,9 +2,7 @@ use crate::response;
|
||||
use crate::ReqCtx;
|
||||
use crate::ServiceSharedResources;
|
||||
use daqbuf_err as err;
|
||||
use err::thiserror;
|
||||
use err::PublicError;
|
||||
use err::ThisError;
|
||||
use err::ToPublicError;
|
||||
use http::Method;
|
||||
use http::StatusCode;
|
||||
@@ -19,13 +17,14 @@ use netpod::NodeConfigCached;
|
||||
use std::sync::Arc;
|
||||
use streams::instrument::InstrumentStream;
|
||||
|
||||
#[derive(Debug, ThisError)]
|
||||
#[cstm(name = "EventData")]
|
||||
pub enum EventDataError {
|
||||
QueryParse,
|
||||
Error(Box<dyn ToPublicError>),
|
||||
InternalError,
|
||||
}
|
||||
autoerr::create_error_v1!(
|
||||
name(EventDataError, "EventData"),
|
||||
enum variants {
|
||||
QueryParse,
|
||||
Error(Box<dyn ToPublicError>),
|
||||
InternalError,
|
||||
},
|
||||
);
|
||||
|
||||
impl ToPublicError for EventDataError {
|
||||
fn to_public_error(&self) -> PublicError {
|
||||
|
||||
@@ -4,10 +4,7 @@ use crate::requests::accepts_json_framed;
|
||||
use crate::requests::accepts_json_or_all;
|
||||
use crate::response;
|
||||
use crate::ServiceSharedResources;
|
||||
use daqbuf_err as err;
|
||||
use dbconn::worker::PgQueue;
|
||||
use err::thiserror;
|
||||
use err::ThisError;
|
||||
use http::header::CONTENT_TYPE;
|
||||
use http::Method;
|
||||
use http::StatusCode;
|
||||
@@ -44,16 +41,17 @@ use streams::streamtimeout::StreamTimeout2;
|
||||
use tracing::Instrument;
|
||||
use tracing::Span;
|
||||
|
||||
#[derive(Debug, ThisError)]
|
||||
#[cstm(name = "Api4Events")]
|
||||
pub enum Error {
|
||||
ChannelNotFound,
|
||||
HttpLib(#[from] http::Error),
|
||||
ChannelConfig(crate::channelconfig::Error),
|
||||
Retrieval(#[from] crate::RetrievalError),
|
||||
EventsCbor(#[from] streams::plaineventscbor::Error),
|
||||
EventsJson(#[from] streams::plaineventsjson::Error),
|
||||
}
|
||||
autoerr::create_error_v1!(
|
||||
name(Error, "Api4Events"),
|
||||
enum variants {
|
||||
ChannelNotFound,
|
||||
HttpLib(#[from] http::Error),
|
||||
ChannelConfig(crate::channelconfig::Error),
|
||||
Retrieval(#[from] crate::RetrievalError),
|
||||
EventsCbor(#[from] streams::plaineventscbor::Error),
|
||||
EventsJson(#[from] streams::plaineventsjson::Error),
|
||||
},
|
||||
);
|
||||
|
||||
impl Error {
|
||||
pub fn user_message(&self) -> String {
|
||||
|
||||
Reference in New Issue
Block a user