Skip to content

Commit 8f1df91

Browse files
Clarify SessionClosedRiverServiceException
1 parent a35821b commit 8f1df91

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/replit_river/error_schema.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
# ERROR_CODE_CANCEL is the code used when either server or client cancels the stream.
1818
ERROR_CODE_CANCEL = "CANCEL"
1919

20-
# ERROR_CODE_SESSION_CLOSED is the code used when either server or client closes
21-
# the session.
22-
ERROR_CODE_SESSION_CLOSED = "CLOSED"
20+
# SYNTHETIC_ERROR_CODE_SESSION_CLOSED is a synthetic code emitted exclusively by the
21+
# client's session. It is not sent over the wire.
22+
SYNTHETIC_ERROR_CODE_SESSION_CLOSED = "SESSION_CLOSED"
2323

2424
# ERROR_CODE_UNKNOWN is the code for the RiverUnknownError
2525
ERROR_CODE_UNKNOWN = "UNKNOWN"
@@ -82,14 +82,12 @@ class StreamClosedRiverServiceException(RiverServiceException):
8282
pass
8383

8484

85-
class SessionClosedRiverServiceException(RiverServiceException):
85+
class SessionClosedRiverServiceException(RiverException):
8686
def __init__(
8787
self,
8888
message: str,
89-
service: str | None,
90-
procedure: str | None,
9189
) -> None:
92-
super().__init__(ERROR_CODE_SESSION_CLOSED, message, service, procedure)
90+
super().__init__(SYNTHETIC_ERROR_CODE_SESSION_CLOSED, message)
9391

9492

9593
def exception_from_message(code: str) -> type[RiverServiceException]:

0 commit comments

Comments
 (0)