raft 0.1.0
Loading...
Searching...
No Matches
errors.hpp
1#pragma once
2
3#include <ostream>
4#include <string>
5#include <variant>
6
7namespace raft
8{
9 namespace errors
10 {
12 struct Unknown
13 {
14 std::string message;
15 };
16
18 struct Timeout
19 {
20 };
21
24 {
25 };
26
29 {
30 std::string message;
31 };
32
34 struct NotLeader
35 {
36 };
37
40 {
41 };
42
45 {
46 };
47
50 {
51 };
52
55 {
56 };
57
60 {
61 };
62
65 {
66 };
67
70 {
71 };
72
75 {
76 std::string message;
77 };
78 } // namespace errors
79
80 using Error = std::variant<errors::Unknown,
93
94} // namespace raft
The network interface or server is already running.
Definition errors.hpp:40
Deserialization error.
Definition errors.hpp:55
The server failed to start.
Definition errors.hpp:50
An invalid argument error.
Definition errors.hpp:29
std::string message
The error message.
Definition errors.hpp:30
No persisted state is available.
Definition errors.hpp:70
The network does not exist.
Definition errors.hpp:65
The replica is not the leader.
Definition errors.hpp:35
The network interface is not running.
Definition errors.hpp:45
Persistence operation failed.
Definition errors.hpp:75
std::string message
The error message.
Definition errors.hpp:76
A timeout has occurred.
Definition errors.hpp:19
An unimplemented error.
Definition errors.hpp:24
The leader is unknown or does not exist.
Definition errors.hpp:60
An unknown error.
Definition errors.hpp:13
std::string message
The error message.
Definition errors.hpp:14