Improvement on error catching in process

This commit is contained in:
Nathan Schneider 2022-08-23 17:04:04 -06:00
parent 9d759530e6
commit b09a7a24b4

View File

@ -11,12 +11,13 @@ function modpol.orgs:call_module(module_slug, initiator, config, result, parent_
-- first, if no slug, just run result
-- may not be necessary if we use false as default approval_module
if not module_slug
and result() then
result()
if not module_slug then
if result() then
result()
end
return
-- if module doesn't exist, abort
elseif not modpol.modules[module_slug] then
-- if module doesn't exist, abort
modpol.ocutil.log('Error in ' .. self.name .. ':call_module -> module "' .. tostring(module_slug) .. '" not found')
return
end