Skip to content

Commit

Permalink
handle missing node in app error
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpdx committed May 19, 2024
1 parent 455e682 commit 52377eb
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions olaf/_internals/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,15 @@ def run(self):
for resource in self._resources:
resource.start(self._node)

if self._node:
try:
reset = self._node.run()
except Exception as e: # pylint: disable=W0718
logger.exception(f"unexpected error was raised by app node: {e}")
reset = NodeStop.SOFT_RESET
if self.node is None:
logger.critical("node was not set")
return

try:
reset = self._node.run()
except Exception as e: # pylint: disable=W0718
logger.exception(f"unexpected error was raised by app node: {e}")
reset = NodeStop.SOFT_RESET

for service in self._services:
service.stop()
Expand Down

0 comments on commit 52377eb

Please sign in to comment.