1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-02-20 21:10:05 +00:00

Merge pull request #490 from zardyh/ComputerCraft/master

Propagate errors arising from API loading
This commit is contained in:
SquidDev 2017-11-15 16:51:26 +00:00
commit 1cf10c5c47

View File

@ -609,14 +609,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 = {}