mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
Log error instead of returning it
Log error when `best_parachain_block_at_target` can't be updated instead of propagating it. Signed-off-by: Serban Iorga <serban@parity.io>
This commit is contained in:
committed by
Bastian Köcher
parent
cd36d1e15f
commit
b21790b769
@@ -138,21 +138,25 @@ where
|
|||||||
&best_para_head_hash.head_hash,
|
&best_para_head_hash.head_hash,
|
||||||
Some(at_block.1),
|
Some(at_block.1),
|
||||||
)
|
)
|
||||||
.await?
|
.await
|
||||||
.and_then(|h| match HeaderOf::<P::SourceParachain>::decode(&mut &h.0[..]) {
|
.and_then(|maybe_encoded_head| match maybe_encoded_head {
|
||||||
Ok(header) => Some(header),
|
Some(encoded_head) =>
|
||||||
Err(e) => {
|
HeaderOf::<P::SourceParachain>::decode(&mut &encoded_head.0[..])
|
||||||
|
.map(|head| Some(head))
|
||||||
|
.map_err(Self::Error::ResponseParseFailed),
|
||||||
|
None => Ok(None),
|
||||||
|
})
|
||||||
|
.map_err(|e| {
|
||||||
log::error!(
|
log::error!(
|
||||||
target: "bridge-metrics",
|
target: "bridge-metrics",
|
||||||
"Failed to decode {} parachain header at {}: {:?}. Metric will have obsolete value",
|
"Failed to read or decode {} parachain header at {}: {:?}. Metric will have obsolete value",
|
||||||
P::SourceParachain::NAME,
|
P::SourceParachain::NAME,
|
||||||
P::TargetChain::NAME,
|
P::TargetChain::NAME,
|
||||||
e,
|
e,
|
||||||
);
|
);
|
||||||
|
e
|
||||||
None
|
})
|
||||||
},
|
.unwrap_or(None);
|
||||||
});
|
|
||||||
if let Some(imported_para_head) = imported_para_head {
|
if let Some(imported_para_head) = imported_para_head {
|
||||||
metrics
|
metrics
|
||||||
.update_best_parachain_block_at_target(para_id, *imported_para_head.number());
|
.update_best_parachain_block_at_target(para_id, *imported_para_head.number());
|
||||||
|
|||||||
Reference in New Issue
Block a user