Skip to content

Commit 556aab2

Browse files
committed
Attempt to fix python issue
1 parent c362415 commit 556aab2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

codegen-server/codegen-server-python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/generators/PythonServerEventStreamWrapperGenerator.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@ class PythonServerEventStreamWrapperGenerator(
206206
let inner = #{Arc}::new(#{AsyncMutex}::new(inner));
207207
$name { inner }
208208
}
209+
210+
pub async fn try_recv_initial(
211+
&self,
212+
message_type: #{SmithyHttp}::event_stream::InitialMessageType,
213+
) -> Result<#{Option}<#{SmithyHttp}::event_stream::Message>, #{SdkError}<#{Error}, #{SmithyHttp}::event_stream::RawMessage>> {
214+
let mut inner = self.inner.lock().await;
215+
inner.try_recv_initial(message_type).await
216+
}
209217
""",
210218
*codegenScope,
211219
"Wrapped" to wrappedT,

codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/protocols/ServerHttpBoundProtocolGenerator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ class ServerHttpBoundProtocolTraitImplGenerator(
917917
.try_recv_initial(#{InitialMessageType}::Request)
918918
.await
919919
.map_err(
920-
|ev_error| #{RequestRejection}::ConstraintViolation(format!("{ev_error}"))
920+
|ev_error| #{RequestRejection}::ConstraintViolation(format!("{ev_error}").into())
921921
)? {
922922
#{parseInitialRequest}
923923
}

0 commit comments

Comments
 (0)