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:
commit
1cf10c5c47
@ -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 = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user