@@ -215,7 +215,7 @@ where
215215 "Error for {} is not recoverable, sending fail_init signal and panicking." ,
216216 request_id
217217 ) ;
218- self . runtime_client . fail_init ( ErrorResponse :: from ( Box :: from ( e) ) ) ;
218+ self . runtime_client . fail_init ( ErrorResponse :: from ( Box :: new ( e) ) ) ;
219219 panic ! ( "Could not send response" ) ;
220220 }
221221 }
@@ -226,15 +226,18 @@ where
226226 "Could not marshal output object to Vec<u8> JSON represnetation for request {}: {}" ,
227227 request_id, e
228228 ) ;
229- self . runtime_client . fail_init ( ErrorResponse :: from ( Box :: from ( e) ) ) ;
229+ self . runtime_client . fail_init ( ErrorResponse :: from ( Box :: new ( e) ) ) ;
230230 panic ! ( "Failed to marshal handler output, panic" ) ;
231231 }
232232 }
233233 }
234234 Err ( e) => {
235235 debug ! ( "Handler returned an error for {}: {}" , request_id, e) ;
236236 debug ! ( "Attempting to send error response to Runtime API for {}" , request_id) ;
237- match self . runtime_client . event_error ( & request_id, ErrorResponse :: from ( e) ) {
237+ match self
238+ . runtime_client
239+ . event_error ( & request_id, ErrorResponse :: from ( Box :: new ( e) ) )
240+ {
238241 Ok ( _) => info ! ( "Error response for {} accepted by Runtime API" , request_id) ,
239242 Err ( e) => {
240243 error ! ( "Unable to send error response for {} to Runtime API: {}" , request_id, e) ;
@@ -243,7 +246,7 @@ where
243246 "Error for {} is not recoverable, sending fail_init signal and panicking" ,
244247 request_id
245248 ) ;
246- self . runtime_client . fail_init ( ErrorResponse :: from ( Box :: from ( e) ) ) ;
249+ self . runtime_client . fail_init ( ErrorResponse :: from ( Box :: new ( e) ) ) ;
247250 panic ! ( "Could not send error response" ) ;
248251 }
249252 }
@@ -271,11 +274,11 @@ where
271274 match err. request_id . clone ( ) {
272275 Some ( req_id) => {
273276 self . runtime_client
274- . event_error ( & req_id, ErrorResponse :: from ( Box :: from ( err) ) )
277+ . event_error ( & req_id, ErrorResponse :: from ( Box :: new ( err) ) )
275278 . expect ( "Could not send event error response" ) ;
276279 }
277280 None => {
278- self . runtime_client . fail_init ( ErrorResponse :: from ( Box :: from ( err) ) ) ;
281+ self . runtime_client . fail_init ( ErrorResponse :: from ( Box :: new ( err) ) ) ;
279282 }
280283 }
281284
@@ -355,7 +358,7 @@ pub(crate) mod tests {
355358 "Handler threw an unexpected error: {}" ,
356359 output. err( ) . unwrap( )
357360 ) ;
358- let output_string = output. unwrap ( ) ;
361+ let output_string = output. ok ( ) . unwrap ( ) ;
359362 assert_eq ! ( output_string, "hello" , "Unexpected output message: {}" , output_string) ;
360363 }
361364}
0 commit comments