Skip to content

Commit

Permalink
Core: Catch and log errors in export hooks
Browse files Browse the repository at this point in the history
Fixes #886
  • Loading branch information
charliefoxtwo committed Jul 27, 2024
1 parent 02ea3e5 commit 7eba894
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Scripts/DCS-BIOS/lib/BIOSStateMachine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ end
function BIOSStateMachine:queue_module_data(module, dev0)
if dev0 ~= nil then
for _, hook in ipairs(module.exportHooks) do
hook(dev0)
local status, result = pcall(hook, dev0)

if not status then
Log:log_error(module.name .. ": error calling export hook")
Log:log_error(result)
end
end
end

Expand Down

0 comments on commit 7eba894

Please sign in to comment.