#[doc(hidden)]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;
#[cfg(doc)]
use crate::zenoh::{Communicator, Observable, Observer, Publisher, Querier, Queryable, Subscriber};
use alloc::{boxed::Box, string::String};
#[cfg(doc)]
use dimas_core::message_types::Message;
use thiserror::Error;
#[cfg(doc)]
use zenoh::query::Query;
#[derive(Error, Debug)]
pub enum Error {
#[error("no implementation available")]
NotImplemented,
#[error("no communicator with id: {0}")]
NoCommunicator(String),
#[error("no zenoh session available")]
NoZenohSession,
#[error("invalid selector for '{0}'")]
InvalidSelector(String),
#[error("creation of zenoh session failed with reason: {source}")]
CreateCommunicator {
source: Box<dyn core::error::Error + Send + Sync>,
},
#[error("getting the publisher failed")]
AccessPublisher,
#[error("a Mutex poison error happened in {0}")]
MutexPoison(String),
#[error("publishing a put message failed with reason: {source}")]
PublishingPut {
source: Box<dyn core::error::Error + Send + Sync>,
},
#[error("publishing a delete message failed with reason: {source}")]
PublishingDelete {
source: Box<dyn core::error::Error + Send + Sync>,
},
#[error("creation of a query failed with reason: {source}")]
QueryCreation {
source: Box<dyn core::error::Error + Send + Sync>,
},
#[error("callback of query failed with reason: {source}")]
QueryCallback {
source: Box<dyn core::error::Error + Send + Sync>,
},
#[error("read storage for {0} failed")]
ReadAccess(String),
#[error("write storage for {0} failed")]
ModifyStruct(String),
#[error("creation of a subscriber failed with reason: {source}")]
SubscriberCreation {
source: Box<dyn core::error::Error + Send + Sync>,
},
#[error("callback of subscriber failed with reason: {source}")]
SubscriberCallback {
source: Box<dyn core::error::Error + Send + Sync>,
},
#[error("accessing querier '{selector}' failed")]
AccessingQuerier {
selector: String,
},
#[error("accessing queryable '{selector}' failed")]
AccessingQueryable {
selector: String,
},
#[error("accessing observable '{selector}' failed")]
AccessingObservable {
selector: String,
},
#[error("the protocol '{protocol}' is unknown")]
UnknownProtocol {
protocol: String,
},
}