mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 14:47:55 +00:00
rpc-api: use thiserror instead of derive_more for error handling (#9631)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
@@ -87,7 +87,7 @@ where
|
||||
|
||||
// FIXME <2329>: Database seems to limit the block number to u32 for no reason
|
||||
let block_num: u32 = num_or_hex.try_into().map_err(|_| {
|
||||
Error::from(format!(
|
||||
Error::Other(format!(
|
||||
"`{:?}` > u32::MAX, the max block number is u32.",
|
||||
num_or_hex
|
||||
))
|
||||
@@ -332,7 +332,9 @@ fn subscribe_headers<Block, Client, F, G, S>(
|
||||
let header = client
|
||||
.header(BlockId::Hash(best_block_hash()))
|
||||
.map_err(client_err)
|
||||
.and_then(|header| header.ok_or_else(|| "Best header missing.".to_string().into()))
|
||||
.and_then(|header| {
|
||||
header.ok_or_else(|| Error::Other("Best header missing.".to_string()))
|
||||
})
|
||||
.map_err(Into::into);
|
||||
|
||||
// send further subscriptions
|
||||
|
||||
Reference in New Issue
Block a user