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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//! `cow-errors` — shared error type for the `CoW` Protocol SDK.
//!
//! [`CowError`] is the unified error type used across the workspace.
//! Every fallible function in the SDK currently returns `Result<T, CowError>`.
//!
//! Per architecture rule 8 (errors per-domain + aggregation), this crate is
//! a migration stopgap: future phases will split `CowError` into per-crate
//! error types (`SigningError`, `OrderbookError`, ...) and aggregate them
//! via a façade-level `SdkError`.
//!
//! # Variants
//!
//! | Variant | When |
//! |---|---|
//! | [`UnknownAsset`](CowError::UnknownAsset) | Asset symbol not in the token registry |
//! | [`Api`](CowError::Api) | Orderbook/subgraph returned non-2xx |
//! | [`Http`](CowError::Http) | Network transport failure |
//! | [`Signing`](CowError::Signing) | ECDSA / EIP-712 signing failure |
//! | [`Parse`](CowError::Parse) | Field parsing / deserialisation error |
//! | [`AppData`](CowError::AppData) | App-data encoding / hashing failure |
//! | [`Rpc`](CowError::Rpc) | JSON-RPC error from an Ethereum node |
//! | [`Unsupported`](CowError::Unsupported) | Feature not available on chain/config |
//! | [`Config`](CowError::Config) | SDK configuration error |
//! | [`ZeroQuantity`](CowError::ZeroQuantity) | Trade amount is zero |
/// Errors that can occur when interacting with the `CoW` Protocol SDK.
///
/// This is the unified error type returned by every fallible function in
/// the workspace. Each variant carries enough context to produce a useful
/// diagnostic message via its [`Display`](std::fmt::Display) implementation.