Merge pull request #173 from webknjaz/bugfixes/weather-curl-timeout

Special-case a curl connection timeout @  widget
This commit is contained in:
streetturtle 2020-07-22 22:30:49 -04:00 committed by GitHub
commit 060b808dce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -393,7 +393,13 @@ 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' and
stderr:find(
'^curl: %(18%) transfer closed with %d+ bytes remaining to read$'
) ~= nil
) then
show_warning(stderr)
end
warning_shown = true