From 96d4ddff1fc5d4868642728148e266bf7be18d1e Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Sat, 28 Sep 2013 19:53:47 +0000 Subject: Send error if listdatabases fails --- db.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'db.lua') 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 -- cgit v1.2.3