diff --git a/chain/ethereum/src/codec.rs b/chain/ethereum/src/codec.rs index 48d42729e4e..1e108b11139 100644 --- a/chain/ethereum/src/codec.rs +++ b/chain/ethereum/src/codec.rs @@ -233,10 +233,9 @@ impl TryInto for &Block { type Error = Error; fn try_into(self) -> Result { - let header = self - .header - .as_ref() - .expect("block header should always be present from gRPC Firehose"); + let header = self.header.as_ref().ok_or_else(|| { + format_err!("block header should always be present from gRPC Firehose") + })?; let block = EthereumBlockWithCalls { ethereum_block: EthereumBlock {