File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -177,14 +177,19 @@ where
177177 Resp : Data + for < ' de > Deserialize < ' de > ,
178178{
179179 async fn generate ( & self , request : SingleIn < Req > ) -> Result < ManyOut < Annotated < Resp > > , Error > {
180- match self . 0 . 0 . generate_in_parts ( request) . await {
180+ match self . 0 . 0 . generate_in_parts ( request) . await {
181181 Ok ( ( mut stream, context) ) => {
182+ let request_id = context. id ( ) . to_string ( ) ;
182183 let first_item = match futures:: StreamExt :: next ( & mut stream) . await {
184+ // TODO - item may still contain an Annotated error. How do we want to handle that?
185+ // TODO - should we be returning an HttpError here?
183186 Some ( item) => item,
184187 None => {
188+ let error_msg = "python async generator stream ended before processing started" ;
189+ tracing:: warn!( request_id, error_msg) ;
185190 return Err ( Error :: new ( std:: io:: Error :: new (
186191 std:: io:: ErrorKind :: UnexpectedEof ,
187- "python async generator stream ended before processing started" ,
192+ error_msg ,
188193 ) ) ) ;
189194 }
190195 } ;
You can’t perform that action at this time.
0 commit comments