From d7a3fe7087683690197fd339e2976d718b9a5dcb Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Mon, 19 Oct 2020 12:07:34 +0100 Subject: [PATCH 1/2] Cast errors generated during synapse_port_db to str --- scripts/synapse_port_db | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/synapse_port_db b/scripts/synapse_port_db index 2d0b59ab534e..6c7664ad4a42 100755 --- a/scripts/synapse_port_db +++ b/scripts/synapse_port_db @@ -22,6 +22,7 @@ import logging import sys import time import traceback +from typing import Optional import yaml @@ -152,7 +153,7 @@ IGNORED_TABLES = { # Error returned by the run function. Used at the top-level part of the script to # handle errors and return codes. -end_error = None +end_error = None # type: Optional[str] # The exec_info for the error, if any. If error is defined but not exec_info the script # will show only the error message without the stacktrace, if exec_info is defined but # not the error then the script will show nothing outside of what's printed in the run @@ -635,7 +636,7 @@ class Porter(object): self.progress.done() except Exception as e: global end_error_exec_info - end_error = e + end_error = str(e) end_error_exec_info = sys.exc_info() logger.exception("") finally: From 1507f23d281ece6630ee6af46045e4e16494210a Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Mon, 19 Oct 2020 12:16:31 +0100 Subject: [PATCH 2/2] Changelog --- changelog.d/8585.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/8585.bugfix diff --git a/changelog.d/8585.bugfix b/changelog.d/8585.bugfix new file mode 100644 index 000000000000..e97e6ac1d8cb --- /dev/null +++ b/changelog.d/8585.bugfix @@ -0,0 +1 @@ +Fix a bug that prevented errors encountered during execution of the `synapse_port_db` from being correctly printed. \ No newline at end of file