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
//! Error and `Result` types for `ant-protocol`.
//!
//! Kept intentionally small: this crate is a wire contract, so the only
//! errors worth reifying are payment-construction failures and wallet
//! I/O errors surfaced by `SingleNodePayment::{pay, verify}`.
//!
//! Callers that embed this crate (the node, the client) keep their own
//! broader error enums and convert via `From<ant_protocol::Error>`.
use fmt;
/// Result alias used throughout this crate.
pub type Result<T> = Result;
/// Errors that can be produced by `ant-protocol` APIs that do I/O or
/// construct payment proofs.
///
/// Wire-format errors (serialize/deserialize, size limits, address
/// mismatches) are reported via [`crate::chunk::ProtocolError`] because
/// they travel across the wire inside response messages.