diff --git a/participation/management/commands/parse_notation_sheets.py b/participation/management/commands/parse_notation_sheets.py index 8f4f10a..0cfe32b 100644 --- a/participation/management/commands/parse_notation_sheets.py +++ b/participation/management/commands/parse_notation_sheets.py @@ -40,7 +40,17 @@ class Command(BaseCommand): for pool in pools.all(): if options['verbosity'] >= 1: self.stdout.write(f"Parsing notation sheet for pool {pool.short_name} for {tournament}") - pool.parse_spreadsheet() - sleep(3) # Three calls = 3s sleep + try: + pool.parse_spreadsheet() + except Exception as e: + if options['verbosity'] >= 1: + self.stderr.write( + self.style.ERROR(f"Error while parsing pool {pool.short_name} for {tournament.name}: {e}")) + finally: + sleep(3) # Three calls = 3s sleep - tournament.parse_tweaks_spreadsheets() + try: + tournament.parse_tweaks_spreadsheets() + except Exception as e: + if options['verbosity'] >= 1: + self.stderr.write(self.style.ERROR(f"Error while parsing tweaks for {tournament.name}: {e}")) diff --git a/participation/management/commands/renew_gdrive_notifications.py b/participation/management/commands/renew_gdrive_notifications.py index d3fee86..d7ad12e 100644 --- a/participation/management/commands/renew_gdrive_notifications.py +++ b/participation/management/commands/renew_gdrive_notifications.py @@ -55,4 +55,7 @@ class Command(BaseCommand): "address": notif_url, "expiration": str(int(1000 * tomorrow.timestamp())), } - http_client.request(method="POST", endpoint=url, json=body).raise_for_status() + try: + http_client.request(method="POST", endpoint=url, json=body).raise_for_status() + except Exception as e: + self.stderr.write(self.style.ERROR(f"Error while renewing notifications for {tournament.name}: {e}"))