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
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Error types for the Hayate engine.
use thiserror::Error;
/// Top-level error type for the engine.
#[derive(Debug, Error)]
pub enum EngineError {
/// An underlying I/O error occurred (e.g. file system or socket issues).
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
/// The client and server protocol versions do not match.
#[error("protocol version mismatch: local {local}, remote {remote}")]
ProtocolMismatch {
/// The local protocol version supported by this node.
local: u16,
/// The remote protocol version sent by the peer.
remote: u16,
},
/// The receiver explicitly rejected the transfer request.
#[error("transfer rejected by receiver")]
TransferRejected,
/// Key exchange authentication failed due to an invalid pairing passphrase.
#[error("invalid passphrase: key exchange authentication failed")]
InvalidPassphrase,
/// An error occurred during cryptographic operations (e.g. encryption/decryption/HKDF).
#[error("crypto error: {0}")]
Crypto(String),
/// An invalid frame structure or size was encountered on the stream.
#[error("invalid frame: {0}")]
InvalidFrame(String),
/// An error occurred during the handshake negotiation phase.
#[error("handshake error: {0}")]
Handshake(String),
/// An error occurred in the underlying QUIC transport or endpoint.
#[error("QUIC error: {0}")]
Quic(String),
/// An error occurred during payload compression or decompression.
#[error("compression error: {0}")]
Compression(String),
/// An archive entry attempted path traversal outside the output directory.
#[error("path traversal attack detected in archive entry")]
PathTraversal,
/// An unspecified error captured via `anyhow`.
#[error(transparent)]
Other(#[from] anyhow::Error),
}