File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -267,9 +267,16 @@ where
267267 return Ok ( r) ;
268268 }
269269
270- let e = serde_json:: from_slice :: < SendError > ( & response_bytes)
271- . expect ( "Failed to deserialize response to send()" ) ;
272- return Err ( AppSendError :: SendError ( e) ) ;
270+ match serde_json:: from_slice :: < SendError > ( & response_bytes) {
271+ Ok ( e) => Err ( AppSendError :: SendError ( e) ) ,
272+ Err ( err) => {
273+ error ! (
274+ "Failed to deserialize response in send(): {} (payload: {:?})" ,
275+ err, response_bytes
276+ ) ;
277+ Err ( AppSendError :: BuildError ( BuildError :: NoBody ) )
278+ }
279+ }
273280}
274281
275282pub async fn send_rmp < R > ( request : Request ) -> Result < R , AppSendError >
@@ -292,9 +299,16 @@ where
292299 return Ok ( r) ;
293300 }
294301
295- let e = rmp_serde:: from_slice :: < SendError > ( & response_bytes)
296- . expect ( "Failed to deserialize response to send()" ) ;
297- return Err ( AppSendError :: SendError ( e) ) ;
302+ match rmp_serde:: from_slice :: < SendError > ( & response_bytes) {
303+ Ok ( e) => Err ( AppSendError :: SendError ( e) ) ,
304+ Err ( err) => {
305+ error ! (
306+ "Failed to deserialize response in send_rmp(): {} (payload: {:?})" ,
307+ err, response_bytes
308+ ) ;
309+ Err ( AppSendError :: BuildError ( BuildError :: NoBody ) )
310+ }
311+ }
298312}
299313
300314// Enum defining the state persistance behaviour
You can’t perform that action at this time.
0 commit comments