summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-09-28 19:53:47 +0000
committerTed Trask <ttrask01@yahoo.com>2013-09-28 19:53:47 +0000
commit96d4ddff1fc5d4868642728148e266bf7be18d1e (patch)
tree098993d4c4e1631d0467741ce029d2d158a42937
parent3f6c7315aa4b141d42aba841f5502ea70d9163b5 (diff)
downloadacf-lib-96d4ddff1fc5d4868642728148e266bf7be18d1e.tar.bz2
acf-lib-96d4ddff1fc5d4868642728148e266bf7be18d1e.tar.xz
Send error if listdatabases fails
-rw-r--r--db.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/db.lua b/db.lua
index 613bb95..6b61df1 100644
--- a/db.lua
+++ b/db.lua
@@ -147,7 +147,11 @@ export.listdatabases = function(dbobject)
cmd[#cmd+1] = "-p"
cmd[#cmd+1] = dbobject.port
end
+ cmd["stderr"]=subprocess.STDOUT
local code, cmdresult = subprocess.call_capture(cmd)
+ if code ~= 0 then
+ error(cmdresult, 0)
+ end
for line in string.gmatch(cmdresult or "", "[^\n]+") do
local table = string.match(line, "%s*([^ |]*)")
if table and table ~= "" then