Error handling: One failing list processor should not affect processing of the other lists

This commit is contained in:
s3lph 2022-04-25 23:16:04 +02:00
parent 612334ae8d
commit eb74f5e296
2 changed files with 5 additions and 2 deletions

View file

@ -74,5 +74,8 @@ def main():
logging.debug('Verbose logging enabled')
lists, smtp = parse_config(ns)
for lst in lists:
try:
lst.process(ns.dry_run)
except BaseException:
logging.exception(f'An error occurred while processing {lst._target}')
smtp.send_messages(Reporter.get_messages())

View file

@ -3,7 +3,7 @@ import unittest
from datetime import datetime
import pgpy.errors
import pgpy.errors # type: ignore
from multischleuder.reporting import KeyConflictMessage, AdminReport, Reporter, UserConflictMessage
from multischleuder.types import SchleuderKey, SchleuderList, SchleuderSubscriber