event_engine/
errors.rs

1//! Errors generated by the engine.
2
3use thiserror::Error;
4use uuid::Uuid;
5
6/// EngineError enumerates all possible error types returned by the event-engine framework.
7#[derive(Error, Debug)]
8pub enum EngineError {
9    #[error("Engine could not create subscription socket")]
10    SubSocketCreateError(#[from] zmq::Error),
11
12    #[error("Engine could not bind subscription socket to TCP port {0}; details: {1}")]
13    SubSocketTCPBindError(String, zmq::Error),
14
15    #[error("Engine could not bind subscription socket to inproc URL {0}")]
16    SubSocketInProcBindError(String),
17
18    #[error("Engine could not bind publish socket to TCP port {0}")]
19    PubSocketTCPBindError(String),
20
21    #[error("Engine could not bind publish socket to inproc URL {0}")]
22    PubSocketInProcBindError(String),
23
24    #[error("Plugin {0} ({1}) aborting, details: {2}")]
25    PluginExecutionError(String, String, String),
26
27    #[error("Engine failed to establish publish socket for plugin: {0}")]
28    PluginPubSocketError(Uuid),
29
30    #[error("Engine failed to establish external socket for plugin: {0}; details: {1}")]
31    PluginExternalSocketError(Uuid, zmq::Error),
32
33    #[error("Engine failed to establish subscription socket for plugin: {0}")]
34    PluginSubSocketError(Uuid),
35
36    #[error("Engine failed to set subscription bytes filter for event name {0} for plugin: {1}:")]
37    PluginSubscriptionError(String, Uuid),
38
39    #[error("Engine failed to establish sync socket for plugin: {0}, port: {1}")]
40    PluginSyncSocketError(Uuid, i32),
41
42    #[error("Engine could not set the subscription filter on the socket.")]
43    EngineSetSubFilterError(),
44
45    #[error(
46        "Engine could not set the 'all' wildcard filter for its incoming socket; details: {0}"
47    )]
48    EngineSetSubFilterAllError(zmq::Error),
49
50    #[error("Plugin {0} failed to send the 'ready' sync message")]
51    PluginSyncSendError(Uuid),
52
53    #[error("Engine failed to create sync socket")]
54    EngineSyncSocketCreateError(),
55
56    #[error("Engine failed to bind to the sync socket on TCP port {0}; details: {1}")]
57    EngineSyncSocketTCPBindError(i32, zmq::Error),
58
59    #[error("Engine failed to bind to the sync socket to inproc URL {0}")]
60    EngineSyncSocketInprocBindError(String),
61
62    #[error("Engine failed to receive a message on the sync socket; details: {0}")]
63    EngineSyncSocketMsgRcvError(zmq::Error),
64
65    #[error("Engine failed to pop sync socket")]
66    EngineSyncSocketPopError(),
67
68    #[error("Engine failed to send a message on the sync socket; details: {0}")]
69    EngineSyncSocketSendRcvError(zmq::Error),
70
71    #[error(
72        "Engine failed to receive a message on the external socket; plugin id: {0}; details: {1}"
73    )]
74    EngineExtSocketRcvError(Uuid, zmq::Error),
75
76    #[error("Engine failed to receive a message on the sub socket for an external plugin; plugin id: {0}; details: {1}")]
77    EngineExtSubSocketRcvError(Uuid, zmq::Error),
78
79    #[error("Engine failed to send a message on the external socket for an external plugin; plugin id: {0}; details: {1}")]
80    EngineExtSocketSendError(Uuid, zmq::Error),
81
82    #[error("Engine failed to send a message on the pub socket for an external plugin; plugin id: {0}; details: {1}")]
83    EngineExtPubSocketSendError(Uuid, zmq::Error),
84}