Skip to content

Commit b1298f7

Browse files
committed
Add more documentation about BlockSourceError
Some BlockSource implementations provide more error details. Document this in case users want to examine it further.
1 parent fbe9f47 commit b1298f7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lightning-block-sync/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ impl BlockSourceError {
132132
}
133133

134134
/// Converts the error into the underlying error.
135+
///
136+
/// May contain an [`std::io::Error`] from the [`BlockSource`]. See implementations for further
137+
/// details, if any.
135138
pub fn into_inner(self) -> Box<dyn std::error::Error + Send + Sync> {
136139
self.error
137140
}

lightning-block-sync/src/rpc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ impl RpcClient {
5757
}
5858

5959
/// Calls a method with the response encoded in JSON format and interpreted as type `T`.
60+
///
61+
/// When an `Err` is returned, [`std::io::Error::into_inner`] may contain an [`RpcError`] if
62+
/// [`std::io::Error::kind`] is [`std::io::ErrorKind::Other`].
6063
pub async fn call_method<T>(&self, method: &str, params: &[serde_json::Value]) -> std::io::Result<T>
6164
where JsonResponse: TryFrom<Vec<u8>, Error = std::io::Error> + TryInto<T, Error = std::io::Error> {
6265
let host = format!("{}:{}", self.endpoint.host(), self.endpoint.port());

0 commit comments

Comments
 (0)