1use bitcoin::Txid;
4
5#[derive(Debug, thiserror::Error)]
15pub enum RpcError {
16 #[error("HTTP transport: {0}")]
17 Transport(#[source] reqwest::Error),
18
19 #[error("JSON-RPC error: code={code}, message={message}")]
20 ServerError { code: i64, message: String },
21
22 #[error("invalid JSON-RPC response: {0}")]
23 InvalidResponse(String),
24
25 #[error("batch response missing item id={id}")]
26 MissingBatchItem { id: u64 },
27}
28
29#[derive(Debug, thiserror::Error)]
35pub enum CoreError {
36 #[error(transparent)]
37 Rpc(#[from] RpcError),
38
39 #[error("transaction not found: {0}")]
40 TxNotFound(Txid),
41
42 #[error("invalid transaction data: {0}")]
43 InvalidTxData(String),
44
45 #[error("label parse error at line {line}: {message}")]
46 LabelParse { line: usize, message: String },
47
48 #[error(transparent)]
49 Io(#[from] std::io::Error),
50}