Vendetta/API/block trap: Difference between revisions
From Quasar-RCE
Jump to navigationJump to search
Created block_trap |
(No difference)
|
Latest revision as of 06:37, 3 March 2025
Definition
lib.block_trap (id, version, run_func) :: nil
Description
Catches errors caused when running the given function and modifies the calling mod's state.
Arguments
- string id: name of the mod to be activated, or the INI file
- string version: version of the mod to be activated, or ignored if the ID is an INI file.
- run_func: the function to trap errors from
Returns
- nil
Other notes
- This function is a ‘lazy pcall alternative’; effectively, combining pcall on the given function with lib.update_state on the calling plugin. If the pcall errors out, the owning plugin will be marked as having errored out.