1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use ockam_core::Error;
pub enum SecureChannelError {
None,
KeyExchange,
InvalidInternalState,
InvalidNonce,
KeyExchangeNotComplete,
InvalidHubResponse,
InvalidLocalInfoType,
}
impl SecureChannelError {
pub const DOMAIN_CODE: u32 = 16_000;
pub const DOMAIN_NAME: &'static str = "OCKAM_SECURE_CHANNEL";
}
#[allow(clippy::from_over_into)]
impl Into<Error> for SecureChannelError {
fn into(self) -> Error {
Error::new(Self::DOMAIN_CODE + (self as u32), Self::DOMAIN_NAME)
}
}