|
| 1 | +//! Errors for friend connections module. |
| 2 | +
|
| 3 | +use failure::Fail; |
| 4 | + |
| 5 | +error_kind! { |
| 6 | + #[doc = "Error that can happen while removing a friend"] |
| 7 | + #[derive(Debug)] |
| 8 | + RemoveFriendError, |
| 9 | + #[doc = "The specific kind of error that can occur."] |
| 10 | + #[derive(Debug, Eq, PartialEq, Fail)] |
| 11 | + RemoveFriendErrorKind { |
| 12 | + #[doc = "Failed to kill net_crypto connection."] |
| 13 | + #[fail(display = "Failed to kill net_crypto connection")] |
| 14 | + KillConnection, |
| 15 | + #[doc = "There is no such friend."] |
| 16 | + #[fail(display = "There is no such friend")] |
| 17 | + NoFriend, |
| 18 | + } |
| 19 | +} |
| 20 | + |
| 21 | +error_kind! { |
| 22 | + #[doc = "Error that can happen while removing a frind"] |
| 23 | + #[derive(Debug)] |
| 24 | + RunError, |
| 25 | + #[doc = "The specific kind of error that can occur."] |
| 26 | + #[derive(Debug, Eq, PartialEq, Fail)] |
| 27 | + RunErrorKind { |
| 28 | + #[doc = "Wakeup timer error."] |
| 29 | + #[fail(display = "Wakeup timer error")] |
| 30 | + Wakeup, |
| 31 | + #[doc = "Failed to kill net_crypto connection."] |
| 32 | + #[fail(display = "Failed to kill net_crypto connection")] |
| 33 | + KillConnection, |
| 34 | + #[doc = "Failed to send packet."] |
| 35 | + #[fail(display = "Failed to send packet")] |
| 36 | + SendTo, |
| 37 | + #[doc = "Failed to add TCP connection."] |
| 38 | + #[fail(display = "Failed to TCP connection")] |
| 39 | + AddTcpConnection, |
| 40 | + #[doc = "Failed to send connection status."] |
| 41 | + #[fail(display = "Failed to send connection status")] |
| 42 | + SendToConnectionStatus |
| 43 | + } |
| 44 | +} |
| 45 | + |
| 46 | +error_kind! { |
| 47 | + #[doc = "Error that can happen while handling `ShareRelays` packet."] |
| 48 | + #[derive(Debug)] |
| 49 | + HandleShareRelaysError, |
| 50 | + #[doc = "The specific kind of error that can occur."] |
| 51 | + #[derive(Debug, Eq, PartialEq, Fail)] |
| 52 | + HandleShareRelaysErrorKind { |
| 53 | + #[doc = "Failed to add TCP connection."] |
| 54 | + #[fail(display = "Failed to TCP connection")] |
| 55 | + AddTcpConnection |
| 56 | + } |
| 57 | +} |
0 commit comments