Skip to main content
Version: v6

Text/error Title Picture

Applicable on struct and enum definitions.

It derives traits necessary for encoding/decoding a custom type as revert error data.

The following traits are derived depending on the ABI mode:

Example

#[ink::error]
struct UnitError;

#[ink::error]
enum MultipleErrors {
UnitError,
ErrorWithParams(bool, u8, String),
ErrorWithNamedParams {
status: bool,
count: u8,
reason: String,
}
}
note

See our Solidity ABI compatibility docs for more details about handling Solidity ABI encoded revert error data.