From 02d6ad938dc797328d3b36315e05a8ecef36e949 Mon Sep 17 00:00:00 2001 From: Marshall Hallenbeck Date: Wed, 12 Apr 2023 16:33:58 -0400 Subject: [PATCH] fix: catch exceptions from proto_flow() and throw them higher --- cme/connection.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cme/connection.py b/cme/connection.py index 8018c8d9..85514260 100755 --- a/cme/connection.py +++ b/cme/connection.py @@ -9,6 +9,7 @@ from functools import wraps from time import sleep from cme.config import pwned_label +from cme.console import cme_console from cme.helpers.logger import highlight from cme.logger import cme_logger, CMEAdapter from cme.context import Context @@ -79,7 +80,10 @@ class connection(object): self.logger.debug(f"Doin' the jitterbug for {value} second(s)") sleep(value) - self.proto_flow() + try: + self.proto_flow() + except Exception as e: + self.logger.exception(f"Exception while calling proto_flow(): {e}") @staticmethod def proto_args(std_parser, module_parser): @@ -110,7 +114,7 @@ class connection(object): return def proto_flow(self): - cme_logger.debug(f"Kicking off proto_flow") + self.logger.debug(f"Kicking off proto_flow") self.proto_logger() if self.create_conn_obj(): self.enum_host_info()