From 4becbaa2717124f0bddb4d64fd1b9568691d2066 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Thu, 3 Jun 2021 17:24:12 +0200 Subject: [PATCH] more useful error message --- client/finality-grandpa/src/import.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/finality-grandpa/src/import.rs b/client/finality-grandpa/src/import.rs index 482859b1f79ef..474f6ee5bf7e5 100644 --- a/client/finality-grandpa/src/import.rs +++ b/client/finality-grandpa/src/import.rs @@ -646,9 +646,10 @@ where initial_sync: bool, ) -> Result<(), ConsensusError> { if justification.0 != GRANDPA_ENGINE_ID { - return Err(ConsensusError::ClientImport( - "GRANDPA can only import GRANDPA Justifications.".into(), - )); + return Err(ConsensusError::ClientImport(format!( + "Expected GRANDPA Justification, got {}.", + String::from_utf8_lossy(&justification.0) + ))); } let justification = GrandpaJustification::decode_and_verify_finalizes(