diff --git a/substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs b/substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs index 930c02ade339..4ed2dc3461a1 100644 --- a/substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs +++ b/substrate/primitives/api/proc-macro/src/impl_runtime_apis.rs @@ -67,7 +67,21 @@ impl Parse for RuntimeApiImpls { uses.push(item) } } else { - impls.push(input.parse::()?); + match input.parse::() { + Ok(res) => impls.push(res), + Err(e) => { + let mut error = syn::Error::new( + input.span(), + r#"Invalid syntax inside block. + supported item are: + - impl blocks + - references to other impl_api_blocks through `external_impls!{ } + "#, + ); + error.combine(e); + return Err(error) + }, + } } }