fuel_streams_core/nats/
error.rsuse async_nats::{
error,
jetstream::{
consumer::StreamErrorKind,
context::{
CreateKeyValueErrorKind,
CreateStreamErrorKind,
PublishError,
},
kv::{PutError, WatchErrorKind},
stream::ConsumerErrorKind,
},
ConnectErrorKind,
};
use displaydoc::Display as DisplayDoc;
use thiserror::Error;
use super::types::PayloadSize;
#[derive(Error, DisplayDoc, Debug)]
pub enum NatsError {
PayloadTooLarge {
subject_name: String,
payload_size: PayloadSize,
max_payload_size: PayloadSize,
},
ConnectionError {
url: String,
#[source]
source: error::Error<ConnectErrorKind>,
},
StoreCreation(#[from] error::Error<CreateKeyValueErrorKind>),
StorePublish(#[from] PutError),
StoreSubscribe(#[from] error::Error<WatchErrorKind>),
StreamPublish(#[from] PublishError),
StreamCreation(#[from] error::Error<CreateStreamErrorKind>),
ConsumerCreate(#[from] error::Error<ConsumerErrorKind>),
ConsumerMessages(#[from] error::Error<StreamErrorKind>),
}