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
34
35
36
37
38
39
40
41
42
43
use thiserror::Error;

#[derive(Error, Debug, PartialEq, Eq)]
pub enum PortalError {
    #[error("Value doesn't exist")]
    NoneError,
    #[error("Provided filename doesn't return a base filename")]
    BadFileName,
    #[error("Provided outdir is not a directory")]
    BadDirectory,
    #[error("Cancelled")]
    Cancelled,
    #[error("Incomplete")]
    Incomplete,
    #[error("Underlying crypto error")]
    CryptoError,
    #[error("Incorrect Mutability")]
    Mutability,
    #[error("Provided storage is too small")]
    BufferTooSmall,
    #[error("Bad registration")]
    BadRegistration,
    #[error("No state initialized")]
    BadState,
    #[error("No peer confirmed")]
    NoPeer,
    #[error("KeyDerivationFailed")]
    BadMsg,
    #[error("EncryptError")]
    PeerKeyMismatch,
    #[error("EncryptError")]
    EncryptError,
    #[error("DecryptError")]
    DecryptError,
    #[error("IOError")]
    IOError,
    #[error("Interrupted")]
    Interrupted,
    #[error("WouldBlock")]
    WouldBlock,
    #[error("Object could not be serialized")]
    SerializeError,
}