chore: log multiple errors (#14064)

* log all errors from db create

* return unique set of errors

* sort set for exceptions list

* run black

(cherry picked from commit c143b37128)
This commit is contained in:
Elizabeth Thompson
2022-03-08 17:31:19 -08:00
committed by Ville Brofeldt
parent e97b123961
commit 253f80ab6d
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