]> git.sesse.net Git - ultimatescore/commitdiff
Deal properly with /queue_status being down.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 30 Oct 2018 21:54:43 +0000 (22:54 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 30 Oct 2018 21:54:43 +0000 (22:54 +0100)
nageru/ultimate.lua

index 49b52fa1664209bc805baa9e171cdf231de63fc3..1bda22f73734a18d25921de13ba044ef1934ce43 100644 (file)
@@ -43,8 +43,11 @@ local NUM_CAMERAS = 6  -- Remember to update neutral_colors, too.
 replay_title = "IPTV"
 cq:wrap(function()
        while true do
-               local headers, stream = assert(http_request.new_from_uri(futatabi_server .. "/queue_status"):go())
-               if headers:get(":status") == "200" then
+               local headers, stream = http_request.new_from_uri(futatabi_server .. "/queue_status"):go()
+               if headers == nil then
+                       replay_title = "IPTV"
+                       print(futatabi_server .. ": Could not connect to get queue_status")
+               elseif headers:get(":status") == "200" then
                        local body = stream:get_body_as_string()
                        if body then
                                replay_title = "IPTV (" .. body .. ")"