diff --git a/app/account_linking.py b/app/account_linking.py index 43b24c9a4..bd66a95eb 100644 --- a/app/account_linking.py +++ b/app/account_linking.py @@ -4,6 +4,7 @@ from typing import Optional import arrow +import sqlalchemy.exc from arrow import Arrow from newrelic import agent from psycopg2.errors import UniqueViolation @@ -192,7 +193,8 @@ def process(self) -> LinkResult: user=new_user, strategy=self.__class__.__name__, ) - except UniqueViolation: + except (UniqueViolation, sqlalchemy.exc.IntegrityError) as e: + LOG.debug(f"Got the duplicate user error: {e}") return self.create_missing_link(canonical_email) def create_missing_link(self, canonical_email: str):