File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313)
1414
1515from replit_river .client_transport import ClientTransport
16- from replit_river .error_schema import RiverError , RiverException
16+ from replit_river .error_schema import ERROR_CODE_UNKNOWN , RiverError , RiverException
1717from replit_river .transport_options import (
1818 HandshakeMetadataType ,
1919 TransportOptions ,
@@ -36,7 +36,6 @@ class RiverUnknownValue(BaseModel):
3636 value : Any
3737
3838
39- @dataclass (frozen = True )
4039class RiverUnknownError (RiverError ):
4140 pass
4241
@@ -56,7 +55,7 @@ def translate_unknown_error(
5655 try :
5756 return handler (value )
5857 except Exception :
59- return RiverUnknownError ()
58+ return RiverUnknownError (code = ERROR_CODE_UNKNOWN , message = "Unknown error" )
6059
6160
6261class Client (Generic [HandshakeMetadataType ]):
Original file line number Diff line number Diff line change 1717# ERROR_CODE_CANCEL is the code used when either server or client cancels the stream.
1818ERROR_CODE_CANCEL = "CANCEL"
1919
20+ # ERROR_CODE_UNKNOWN is the code for the RiverUnknownError
21+ ERROR_CODE_UNKNOWN = "UNKNOWN"
22+
2023
2124class RiverError (BaseModel ):
2225 """Error message from the server."""
You can’t perform that action at this time.
0 commit comments