diff --git a/Pipfile.lock b/Pipfile.lock index 34c6fd9f..4a7c62c2 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1261,11 +1261,12 @@ }, "jinja2": { "hashes": [ - "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852", - "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61" + "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa", + "sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90" ], + "index": "pypi", "markers": "python_version >= '3.7'", - "version": "==3.1.2" + "version": "==3.1.3" }, "markupsafe": { "hashes": [ @@ -1522,4 +1523,4 @@ "version": "==3.0.1" } } -} +} \ No newline at end of file diff --git a/_infra/helm/party/Chart.yaml b/_infra/helm/party/Chart.yaml index 4bc1d0bb..36bfb212 100644 --- a/_infra/helm/party/Chart.yaml +++ b/_infra/helm/party/Chart.yaml @@ -14,8 +14,8 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 2.4.35 +version: 2.4.36 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 2.4.35 +appVersion: 2.4.36 diff --git a/ras_party/support/session_decorator.py b/ras_party/support/session_decorator.py index 7e116ed7..4666017a 100644 --- a/ras_party/support/session_decorator.py +++ b/ras_party/support/session_decorator.py @@ -3,7 +3,7 @@ import structlog from flask import current_app -from sqlalchemy.exc import SQLAlchemyError +from sqlalchemy.exc import OperationalError, SQLAlchemyError logger = structlog.wrap_logger(logging.getLogger(__name__)) @@ -31,8 +31,11 @@ def handle_query_only_session(f, args, kwargs): try: result = f(*args, session=session, **kwargs) return result - except SQLAlchemyError: - logger.error("Something went wrong accessing database", exc_info=True) + except SQLAlchemyError as exc: + if isinstance(exc, OperationalError): + logger.error("Connection to database interrupted", exc_info=True) + else: + logger.error(f"Something went wrong accessing database due to {exc.__class__.__name__}", exc_info=True) raise finally: current_app.db.session.remove() @@ -44,8 +47,11 @@ def handle_quiet_session(f, args, kwargs): result = f(*args, session=session, **kwargs) session.commit() return result - except SQLAlchemyError: - logger.error("Something went wrong accessing database", exc_info=True) + except SQLAlchemyError as exc: + if isinstance(exc, OperationalError): + logger.error("Connection to database interrupted", exc_info=True) + else: + logger.error(f"Something went wrong accessing database due to {exc.__class__.__name__}", exc_info=True) session.rollback() raise finally: