Skip to content

Commit 7801aa1

Browse files
author
Ekaterina Sokolova
committed
Improve error handling.
1 parent a81edd4 commit 7801aa1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/tpcds.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ def setup_tpcds(config):
2626
try:
2727
conn = psycopg2.connect(**config)
2828
cur = conn.cursor()
29+
except Exception as e:
30+
raise DataLoadException('Load failed: %s' % e)
2931

32+
try:
3033
# Create pg_query_state extension
3134
cur.execute('CREATE EXTENSION IF NOT EXISTS pg_query_state')
3235

@@ -131,8 +134,8 @@ def run_tpcds(config):
131134
timeout_list.append(i + 1)
132135

133136
if err_count > 2:
134-
print("ERROR: error in message queue data transmitting")
135-
raise
137+
print("\nERROR: error in message queue data transmitting")
138+
raise Exception('error was received %d times'%err_count)
136139
elif err_count > 0:
137140
print(err_count, " times there was error in message queue data transmitting")
138141

0 commit comments

Comments
 (0)