Skip to content

Commit

Permalink
Fix bad error
Browse files Browse the repository at this point in the history
  • Loading branch information
john681611 committed Nov 9, 2023
1 parent d52c4f3 commit 99e08c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion application/database/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
StructuredRel,
db,
)
import neo4j
from sqlalchemy.orm import aliased
import os
import logging
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 99e08c3

Please sign in to comment.