diff --git a/application/database/db.py b/application/database/db.py index ae007d22..23c5db66 100644 --- a/application/database/db.py +++ b/application/database/db.py @@ -13,6 +13,7 @@ StructuredRel, db, ) +import neo4j from sqlalchemy.orm import aliased import os import logging @@ -547,7 +548,11 @@ def standards(self) -> List[str]: @classmethod def everything(self) -> List[str]: - return [NEO_DB.parse_node(rec) for rec in NeoDocument.nodes.all()] + try: + return [NEO_DB.parse_node(rec) for rec in NeoDocument.nodes.all()] + except neo4j.exceptions.ServiceUnavailable: + logger.error("Neo4j DB offline") + return None @staticmethod def parse_node(node: NeoDocument) -> cre_defs.Document: