The errors
Contract
The errors
contract is one of the core contracts on each IOTA Smart Contracts
chain.
The errors
contract keeps a map of error codes to error message templates.
This allows contracts to store lengthy error strings only once and then reuse them by just providing the error code (and
optional extra values) when producing an error, thus saving storage and gas.
Entry Points
registerError
Registers an error message template.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
errorMessageFormat | string | No | The error message template, which supports standard go verbs for variable printing |
Returns
Name | Type | Description |
---|---|---|
vmErrorCode | VMErrorCode | The error code of the registered template |
Views
getErrorMessageFormat
Returns the message template stored for a given error code.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
vmErrorCode | VMErrorCode | No | The error code of the registered template |
Returns
Name | Type | Description |
---|---|---|
errorMessageFormat | string | The error message template |