summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-09-06 15:10:16 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-09-06 15:10:16 +0100
commit3a0bc5764466754f883ac987d958eead6de877e8 (patch)
tree7c57b39365ec8f395ec864006e38fc5f3c3482ed
parent05d8f110fdc5eca353307e977e9d78c72ee2d522 (diff)
downloadgitano-3a0bc5764466754f883ac987d958eead6de877e8.tar.gz
ACTIONS: Transform connect errors into '500' errors instead
-rw-r--r--lib/gitano/actions.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitano/actions.lua b/lib/gitano/actions.lua
index 1da7cbb..c19a97c 100644
--- a/lib/gitano/actions.lua
+++ b/lib/gitano/actions.lua
@@ -48,7 +48,10 @@ local function http_txn(method, host, path, headers, body)
if host:match(":") then
host, port = host:match("^(.-):([^:]+)$")
end
- sock = assert(sio.connect(host, port))
+ local sock, err = sio.connect(host, port)
+ if not sock then
+ return "500", err, {}, ""
+ end
local req_lines = {
method .. " " .. path .. " HTTP/1.0",
"Host: " .. host,