Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Cast errors generated during synapse_port_db to str #8585

Merged
merged 2 commits into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8585.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug that prevented errors encountered during execution of the `synapse_port_db` from being correctly printed.
5 changes: 3 additions & 2 deletions scripts/synapse_port_db
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import logging
import sys
import time
import traceback
from typing import Optional

import yaml

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down