From f507a2c43fc4d96bd5089665ab68dfef071fb6e0 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 16 Jul 2020 10:46:02 +0200 Subject: Special-case a curl connection timeout @ ⛅ widget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow-up for #169. --- weather-widget/weather.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weather-widget/weather.lua b/weather-widget/weather.lua index e3fe118..b6b3c11 100644 --- a/weather-widget/weather.lua +++ b/weather-widget/weather.lua @@ -393,7 +393,10 @@ local function worker(args) local function update_widget(widget, stdout, stderr) if stderr ~= '' then if not warning_shown then - if stderr ~= 'curl: (52) Empty reply from server' then + if ( + stderr ~= 'curl: (52) Empty reply from server' and + stderr ~= 'curl: (28) Failed to connect to api.openweathermap.org port 443: Connection timed out' + ) then show_warning(stderr) end warning_shown = true -- cgit v1.2.3 From c64243d23bbe5e35088dcb6e3ff5353d288ebda3 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sun, 19 Jul 2020 18:45:08 +0200 Subject: Special-case curl error 18 in ⛅ widget too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weather-widget/weather.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weather-widget/weather.lua b/weather-widget/weather.lua index b6b3c11..7e65901 100644 --- a/weather-widget/weather.lua +++ b/weather-widget/weather.lua @@ -395,7 +395,10 @@ local function worker(args) if not warning_shown then if ( stderr ~= 'curl: (52) Empty reply from server' and - stderr ~= 'curl: (28) Failed to connect to api.openweathermap.org port 443: Connection timed out' + stderr ~= 'curl: (28) Failed to connect to api.openweathermap.org port 443: Connection timed out' and + stderr:find( + '^curl: %(18%) transfer closed with %d+ bytes remaining to read$' + ) ~= nil ) then show_warning(stderr) end -- cgit v1.2.3