Skip to content

Commit f69797c

Browse files
jeffreylovitzswilly22
authored andcommitted
Switch to last-return exception checking
1 parent 0196420 commit f69797c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

redisgraph/query_result.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from .node import Node
22
from .edge import Edge
33
from prettytable import PrettyTable
4+
from redis import ResponseError
45

56

67
class ResultSetColumnTypes(object):
@@ -35,6 +36,10 @@ def __init__(self, graph, response):
3536
self.header = []
3637
self.result_set = []
3738

39+
# If we encountered a run-time error, the last response element will be an exception.
40+
if isinstance(response[-1], ResponseError):
41+
raise response[-1]
42+
3843
if len(response) is 1:
3944
self.parse_statistics(response[0])
4045
else:

0 commit comments

Comments
 (0)