1use serde::{Deserialize, Serialize};
2use thiserror::Error;
3
4#[derive(Debug, Serialize, Deserialize, Clone, Error)]
5pub enum Error {
6 #[error("Connection or service name is not allowed")]
9 NotAllowed,
10 #[error("Requested endpoint is not registered")]
12 NoEndpoint,
13 #[error("Service or endpoint is already registered")]
15 AlreadyRegistered,
16 #[error("Requested service is not found")]
18 ServiceNotFound,
19 #[error("Peer disconencted")]
21 PeerDisconnected,
22 #[error("Invalid call params: {0}")]
24 ParamsTypeError(String),
25 #[error("Invalid result type: {0}")]
28 ResultTypeError(String),
29 #[error("Internal Krossbar error: {0}. Please report the issue")]
31 InternalError(String),
32 #[error("Client returned an error: {0}")]
34 ClientError(String),
35}
36
37pub type Result<T> = std::result::Result<T, Error>;