]> git.ipfire.org Git - ipfire.org.git/commitdiff
Revert "Revert "database: Reconnect on programmimg errors""
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Nov 2017 11:51:28 +0000 (12:51 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Nov 2017 11:51:28 +0000 (12:51 +0100)
This reverts commit 8496969ccb252de801c1d8ca7efa255a25712d5c.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
webapp/backend/database.py

index b158baa91a5fed24d567fc837ea2b4cb31f85750..7b7892ebe0158d93a3ee47163fc9b5a5df109486 100644 (file)
@@ -176,7 +176,7 @@ class Connection(object):
 
                try:
                        return cursor.execute(query, kwparameters or parameters)
-               except OperationalError:
+               except (OperationalError, psycopg2.ProgrammingError):
                        logging.error("Error connecting to database on %s", self.host)
                        self.close()
                        raise