diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-09-28 19:53:47 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-09-28 19:53:47 +0000 |
commit | 96d4ddff1fc5d4868642728148e266bf7be18d1e (patch) | |
tree | 098993d4c4e1631d0467741ce029d2d158a42937 | |
parent | 3f6c7315aa4b141d42aba841f5502ea70d9163b5 (diff) | |
download | acf-lib-96d4ddff1fc5d4868642728148e266bf7be18d1e.tar.bz2 acf-lib-96d4ddff1fc5d4868642728148e266bf7be18d1e.tar.xz |
Send error if listdatabases fails
-rw-r--r-- | db.lua | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |