I want to add custom error types to a working pallet (permalink duniter-wot/src/lib.rs). In this current state, cargo check
pass successfully.
According to Substrate documentation frame-macros/#palleterror, I'm adding inside the #[frame_support::pallet]
block a #[pallet::error]
macro with an enumeration named Error
with a generic type like:
#[pallet::error]
pub enum Error<T> {
/// variant one
VariantOne,
/// variant two
VariantTwo,
}
But as soon as I do this, cargo check
returns a long (> 700 lines) error trace in which the first element is:
error: Invalid generic declaration, trait is defined with instance but generic use none
--> pallets/duniter-wot/src/lib.rs:99:20
|
99 | pub enum Error<T> {
| ^
The question, more than "how to fix this" would be "how am I supposed to understand this hint" and "what resources/tools/documentation could help me debug myself".