Trait polkadot_sdk_frame::traits::PalletError
pub trait PalletError: Encode + Decode {
const MAX_ENCODED_SIZE: usize;
}
Expand description
Trait indicating that the implementing type is going to be included as a field in a variant of
the #[pallet::error]
enum type.
§Notes
The pallet error enum has a maximum encoded size as defined by
[frame_support::MAX_MODULE_ERROR_ENCODED_SIZE
]. If the pallet error type exceeds this size
limit, a static assertion during compilation will fail. The compilation error will be in the
format of error[E0080]: evaluation of constant value failed
due to the usage of
const assertions.
Required Associated Constants§
const MAX_ENCODED_SIZE: usize
const MAX_ENCODED_SIZE: usize
The maximum encoded size for the implementing type.
This will be used to check whether the pallet error type is less than or equal to
[frame_support::MAX_MODULE_ERROR_ENCODED_SIZE
], and if it is, a compilation error will be
thrown.
Object Safety§
This trait is not object safe.