paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.82k stars 661 forks source link

[XCM] don't ignore errors #2408

Open xlc opened 10 months ago

xlc commented 10 months ago
          someone should make a rule to disallow ignoring errors

_Originally posted by @xlc in https://github.com/paritytech/polkadot-sdk/pull/2405#discussion_r1398704951_

Need to make sure every .map_err(|_| are justified with good reasons.

bkchr commented 10 months ago

map_err is not ignoring the error, it just maps it... as the name is already hinting.

xlc commented 10 months ago

but |_| is ignoring it and it looks like a sad face

ggwpez commented 6 months ago

Should probably still be logged to ease debuggability.

ayevbeosa commented 3 months ago

Hi @xlc, I am interested in working on this, my assumption is for occurrences of .map_err(|_|, it would look like this .map_err(|e| { log::error!(target: "xcm::pallet_xcm::function_name", "Some description: {:?}", e);

xlc commented 3 months ago

yes