[][src]Trait actix_raft::AppError

pub trait AppError: Error + Debug + Send + Sync + Serialize + DeserializeOwned + 'static { }

A trait defining application specific error types.

The intention of this trait is that applications which are using this crate will be able to pass their own concrete error types up from the storage layer, through the Raft system, to the higher levels of their application for more granular control. Many applications will need to be able to communicate application specific logic from the storage layer.

NOTE WELL: if an AppError is returned from any of the RaftStorage interfaces, other than the AppendEntryToLog interface, then the Raft node will immediately shutdown. This is due to the fact that custom error handling logic is only allowed in the AppendEntryToLog interface while the Raft node is the cluster leader. When the node is in any other state, the storage layer is expected to operate without any errors. Shutting down immediately is how Raft attempts to guard against data corruption and the like.

At this point in time, AppError concrete types are required to implement the serde types for easier integration within parent apps. This may change in the future depending on how useful this pattern is, or if it ends up just getting in the way.

Implementors

Loading content...