chore: log multiple errors (#14064)

* log all errors from db create

* return unique set of errors

* sort set for exceptions list

* run black
This commit is contained in:
Elizabeth Thompson
2022-03-08 17:31:19 -08:00
committed by GitHub
parent d539fc217a
commit c143b37128
3 changed files with 46 additions and 1 deletions

View File

@@ -92,6 +92,9 @@ class CreateDatabaseCommand(BaseCommand):
exception = DatabaseInvalidError()
exception.add_list(exceptions)
event_logger.log_with_context(
action=f"db_connection_failed.{exception.__class__.__name__}"
action="db_connection_failed.{}.{}".format(
exception.__class__.__name__,
".".join(exception.get_list_classnames()),
)
)
raise exception