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 @@ -277,9 +277,16 @@ where
277277 return Ok ( r) ;
278278 }
279279
280- let e = serde_json:: from_slice :: < SendError > ( & response_bytes)
281- . expect ( "Failed to deserialize response to send()" ) ;
282- return Err ( AppSendError :: SendError ( e) ) ;
280+ match serde_json:: from_slice :: < SendError > ( & response_bytes) {
281+ Ok ( e) => Err ( AppSendError :: SendError ( e) ) ,
282+ Err ( err) => {
283+ error ! (
284+ "Failed to deserialize response in send(): {} (payload: {:?})" ,
285+ err, response_bytes
286+ ) ;
287+ Err ( AppSendError :: BuildError ( BuildError :: NoBody ) )
288+ }
289+ }
283290}
284291
285292pub async fn send_rmp < R > ( request : Request ) -> Result < R , AppSendError >
@@ -302,9 +309,16 @@ where
302309 return Ok ( r) ;
303310 }
304311
305- let e = rmp_serde:: from_slice :: < SendError > ( & response_bytes)
306- . expect ( "Failed to deserialize response to send()" ) ;
307- return Err ( AppSendError :: SendError ( e) ) ;
312+ match rmp_serde:: from_slice :: < SendError > ( & response_bytes) {
313+ Ok ( e) => Err ( AppSendError :: SendError ( e) ) ,
314+ Err ( err) => {
315+ error ! (
316+ "Failed to deserialize response in send_rmp(): {} (payload: {:?})" ,
317+ err, response_bytes
318+ ) ;
319+ Err ( AppSendError :: BuildError ( BuildError :: NoBody ) )
320+ }
321+ }
308322}
309323
310324// Enum defining the state persistance behaviour
You can’t perform that action at this time.
0 commit comments