mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
load_script error handling fix
This commit is contained in:
parent
4ad48bdb63
commit
becd1d11ae
1 changed files with 6 additions and 2 deletions
|
|
@ -37,10 +37,14 @@ function load_script(path, nocache)
|
|||
if not nocache and __cached_scripts[fullpath] ~= nil then
|
||||
return __cached_results[fullpath]
|
||||
end
|
||||
local script = loadfile(fullpath)
|
||||
if script == nil then
|
||||
if not file.isfile(fullpath) then
|
||||
error("script '"..filename.."' not found in '"..packname.."'")
|
||||
end
|
||||
|
||||
local script, err = loadfile(fullpath)
|
||||
if script == nil then
|
||||
error(err)
|
||||
end
|
||||
local result = script()
|
||||
if not nocache then
|
||||
__cached_scripts[fullpath] = script
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue