Module Errors
27 21 pallets 326 errorsWraps pallet-specific errors with pallet index and error bytes
How Module Error Encoding Works
A ModuleError contains two
fields: an index (u8) that identifies the pallet, and an error ([u8; 4]) where the first byte identifies the specific error within that
pallet's error enum.
To decode: look up the pallet by index in the mapping table below, then find the error by the first byte of error in that pallet's errors
list.
Fields
| Name | Type | Description |
|---|---|---|
| index | u8 | Pallet index — maps to pallet.index in pallet files |
| error | [u8; 4] | Error bytes — first byte is the error index within the pallet's error enum |
Pallet Mapping
The index field maps to a pallet. Each pallet defines its own error enum with pallet-specific error codes.
| Pallet Index | Pallet Name | Active Errors |
|---|---|---|
| 0 | System | 9 errors |
| 4 | Grandpa | 7 errors |
| 5 | Balances | 12 errors |
| 7 | SubtensorModule | 135 errors |
| 11 | Utility | 2 errors |
| 12 | Sudo | 1 error |
| 13 | Multisig | 14 errors |
| 14 | Preimage | 8 errors |
| 15 | Scheduler | 5 errors |
| 16 | Proxy | 10 errors |
| 17 | Registry | 3 errors |
| 18 | Commitments | 4 errors |
| 19 | AdminUtils | 11 errors |
| 20 | SafeMode | 7 errors |
| 21 | Ethereum | 2 errors |
| 22 | EVM | 15 errors |
| 26 | Drand | 6 errors |
| 27 | Crowdloan | 22 errors |
| 28 | Swap | 14 errors |
| 29 | Contracts | 37 errors |
| 30 | MevShield | 2 errors |
Type Information
- Type ID
- 27
- Path
- sp_runtime::ModuleError
- Pallets with Errors
- 21
- Runtime
- v393