Skip to content

Commit 8cd8c8c

Browse files
client.send_subscription always returns a "A | RiverError"
1 parent 1c569fe commit 8cd8c8c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/replit_river/codegen/client.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,12 @@ async def {name}(
10131013
]
10141014
)
10151015
elif procedure.type == "subscription":
1016+
output_or_error_type = UnionTypeExpr(
1017+
[
1018+
output_or_error_type,
1019+
TypeName("RiverError"),
1020+
]
1021+
)
10161022
current_chunks.extend(
10171023
[
10181024
reindent(
@@ -1086,7 +1092,12 @@ async def {name}(
10861092
]
10871093
)
10881094
elif procedure.type == "stream":
1089-
output_or_error_type = UnionTypeExpr([output_or_error_type, TypeName("RiverError")])
1095+
output_or_error_type = UnionTypeExpr(
1096+
[
1097+
output_or_error_type,
1098+
TypeName("RiverError"),
1099+
]
1100+
)
10901101
if init_type:
10911102
assert render_init_method, "Expected an init renderer!"
10921103
current_chunks.extend(

0 commit comments

Comments
 (0)