Skip to content

Commit 558982c

Browse files
committed
feat: handle error events
1 parent 339319a commit 558982c

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

wherobots/db/connection.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ def __listen(self):
153153
f"Unsupported results format {result_format}"
154154
)
155155
)
156+
case EventKind.ERROR:
157+
query.state = ExecutionState.FAILED
158+
error = message.get("message")
159+
query.handler(OperationalError(error))
156160
case _:
157161
logging.warning("Received unknown %s event!", kind)
158162

wherobots/db/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class RequestKind(StrEnum):
4646
class EventKind(StrEnum):
4747
STATE_UPDATED = auto()
4848
EXECUTION_RESULT = auto()
49+
ERROR = auto()
4950

5051

5152
class ResultsFormat(StrEnum):

0 commit comments

Comments
 (0)