Error handling: One failing list processor should not affect processing of the other lists
This commit is contained in:
parent
612334ae8d
commit
eb74f5e296
2 changed files with 5 additions and 2 deletions
|
@ -74,5 +74,8 @@ def main():
|
||||||
logging.debug('Verbose logging enabled')
|
logging.debug('Verbose logging enabled')
|
||||||
lists, smtp = parse_config(ns)
|
lists, smtp = parse_config(ns)
|
||||||
for lst in lists:
|
for lst in lists:
|
||||||
|
try:
|
||||||
lst.process(ns.dry_run)
|
lst.process(ns.dry_run)
|
||||||
|
except BaseException:
|
||||||
|
logging.exception(f'An error occurred while processing {lst._target}')
|
||||||
smtp.send_messages(Reporter.get_messages())
|
smtp.send_messages(Reporter.get_messages())
|
||||||
|
|
|
@ -3,7 +3,7 @@ import unittest
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
import pgpy.errors
|
import pgpy.errors # type: ignore
|
||||||
|
|
||||||
from multischleuder.reporting import KeyConflictMessage, AdminReport, Reporter, UserConflictMessage
|
from multischleuder.reporting import KeyConflictMessage, AdminReport, Reporter, UserConflictMessage
|
||||||
from multischleuder.types import SchleuderKey, SchleuderList, SchleuderSubscriber
|
from multischleuder.types import SchleuderKey, SchleuderList, SchleuderSubscriber
|
||||||
|
|
Loading…
Reference in a new issue