mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Update callback.lua
This PR modifies the Callbacks:Execute method to improve error handling when a callback fails.
This commit is contained in:
@@ -26,9 +26,11 @@ function Callbacks:Execute(cb, ...)
|
|||||||
|
|
||||||
if not success then
|
if not success then
|
||||||
print(("[^1ERROR^7] Failed to execute Callback with RequestId: ^5%s^7"):format(self.currentId))
|
print(("[^1ERROR^7] Failed to execute Callback with RequestId: ^5%s^7"):format(self.currentId))
|
||||||
error(errorString)
|
print("^3Callback Error:^7 " .. tostring(errorString)) -- just log, don't throw
|
||||||
|
self.currentId = nil
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
self.currentId = nil
|
self.currentId = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user