diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-09-06 15:10:16 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-09-06 15:10:16 +0100 |
commit | 3a0bc5764466754f883ac987d958eead6de877e8 (patch) | |
tree | 7c57b39365ec8f395ec864006e38fc5f3c3482ed | |
parent | 05d8f110fdc5eca353307e977e9d78c72ee2d522 (diff) | |
download | gitano-3a0bc5764466754f883ac987d958eead6de877e8.tar.gz |
ACTIONS: Transform connect errors into '500' errors instead
-rw-r--r-- | lib/gitano/actions.lua | 5 |
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, |