Skip to content

Commit

Permalink
catch connection errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Nov 2, 2023
1 parent 2c7210b commit ff7aa3c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mycodo/utils/github_release_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import logging
import os
import re
import socket
import sys
import urllib
from urllib.request import urlopen

from packaging.version import parse
Expand Down Expand Up @@ -40,6 +42,10 @@ def update_mycodo_tags(self):
tag_full = each_tag['ref'].split('/')
if len(tag_full) == 3 and re.match('v(\d+)\.(\d+)\.\d+', tag_full[2]):
parsed_tags.append(tag_full[2])
except socket.gaierror:
logger.error("Cannot connect")
except urllib.error.URLError:
logger.error("Cannot resolve name")
except Exception:
logger.exception("update_mycodo_tags()")
self.mycodo_tags = parsed_tags
Expand Down

0 comments on commit ff7aa3c

Please sign in to comment.