diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-06-27 13:05:34 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-06-27 13:25:40 +0000 |
commit | 0f4f2c4383e2afb276b877971c1a1ad93ecea877 (patch) | |
tree | ced84f3cc3b52d496fe04845f581d886ad641e72 | |
parent | e3ca5e480799edefbe1ff3a69a7938067d8fffe0 (diff) | |
download | acf-provisioning-0f4f2c4383e2afb276b877971c1a1ad93ecea877.tar.bz2 acf-provisioning-0f4f2c4383e2afb276b877971c1a1ad93ecea877.tar.xz |
Fix exception when script has bad syntax
(cherry picked from commit 425a6bba74117818f1bb3578b005acff433df7e9)
-rw-r--r-- | provisioning-model.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/provisioning-model.lua b/provisioning-model.lua index f8815f3..6e61572 100644 --- a/provisioning-model.lua +++ b/provisioning-model.lua @@ -257,7 +257,7 @@ validateparamcoded = function(p, top) end local function callscript(script, ...) - local result + local result={} local env = {} setmetatable (env, {__index = _G}) -- loadfile loads into the global environment @@ -271,6 +271,9 @@ local function callscript(script, ...) if not res and err then assert(res, "Exception in "..script.." script\n"..err) end + elseif posix.stat(script) then + -- file exists, but wouldn't load + error("Failed to load "..script, 0) end setfenv (0, _G) return unpack(result) |