Skip to content

Commit

Permalink
Using xpcall for events instead of pcall
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Nov 3, 2024
1 parent 061a313 commit 2fef5c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ local common_events = {
return
end

local okay, errortext = pcall(func, event, ...)
local okay, errortext = xpcall(func, geterrorhandler(), event, ...)

if (not okay) then
--trigger an error msg
Expand All @@ -278,7 +278,7 @@ local common_events = {
return
end

local okay, errortext = pcall(func, context, event, ...)
local okay, errortext = xpcall(func, geterrorhandler(), context, event, ...)

if (not okay) then
--attempt to get the context name
Expand Down

0 comments on commit 2fef5c9

Please sign in to comment.