fix: log connection errors when retrieving lemmy admins

pull/20/head
db0 2023-09-11 23:44:50 +02:00
parent d824d9190e
commit 3eb37fa034
1 changed files with 5 additions and 1 deletions

View File

@ -5,7 +5,11 @@ from fediseer.consts import FEDISEER_VERSION
def get_lemmy_admins(domain): def get_lemmy_admins(domain):
requested_lemmy = Lemmy(f"https://{domain}") requested_lemmy = Lemmy(f"https://{domain}")
site = requested_lemmy.site.get() try:
site = requested_lemmy.site.get()
except Exception as err:
logger.error(f"Error retrieving mastodon site info for {domain}: {err}")
raise err
if not site: if not site:
logger.error(f"Error retrieving mastodon site info for {domain}") logger.error(f"Error retrieving mastodon site info for {domain}")
raise Exception(f"Error retrieving mastodon site info for {domain}") raise Exception(f"Error retrieving mastodon site info for {domain}")