From 52c58f61b5a9799ccbd8ef5dd067f502b81e9aaf Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 30 Oct 2018 22:54:43 +0100 Subject: [PATCH] Deal properly with /queue_status being down. --- nageru/ultimate.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nageru/ultimate.lua b/nageru/ultimate.lua index 49b52fa..1bda22f 100644 --- a/nageru/ultimate.lua +++ b/nageru/ultimate.lua @@ -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 .. ")" -- 2.39.2