1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-12 19:20: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
local ok, err = pcall( fnAPI )
if not ok then
printError( err )
tAPIsLoading[sName] = nil
return false
return error( "Failed to load API " .. sName .. " due to " .. err, 1 )
end
else
printError( err )
tAPIsLoading[sName] = nil
return false
return error( "Failed to load API " .. sName .. " due to " .. err, 1 )
end
local tAPI = {}