1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-13 11:40:29 +00:00

Propagate errors arising from API loading

This commit is contained in:
hydraz 2017-11-15 14:22:36 -02:00
parent 19e4c03d3a
commit d766f8b34e

View File

@ -644,14 +644,12 @@ function os.loadAPI( _sPath )
if fnAPI then if fnAPI then
local ok, err = pcall( fnAPI ) local ok, err = pcall( fnAPI )
if not ok then if not ok then
printError( err )
tAPIsLoading[sName] = nil tAPIsLoading[sName] = nil
return false return error( "Failed to load API " .. sName .. " due to " .. err, 1 )
end end
else else
printError( err )
tAPIsLoading[sName] = nil tAPIsLoading[sName] = nil
return false return error( "Failed to load API " .. sName .. " due to " .. err, 1 )
end end
local tAPI = {} local tAPI = {}