@@ -76,7 +76,9 @@ async fn copy<A: Endpoint<A>, B: Endpoint<B>>(
76
76
// which `Vec<u8>` implements!
77
77
debug ! ( "{}: before read" , dbg_name) ;
78
78
let retval = from. read ( buf) ;
79
- let ( res, buf_read) = timeout ( READ_TIMEOUT , retval) . await ?;
79
+ let ( res, buf_read) = timeout ( READ_TIMEOUT , retval)
80
+ . await
81
+ . map_err ( |e| -> String { format ! ( "{} read: {}" , dbg_name, e) } ) ?;
80
82
// Propagate errors, see how many bytes we read
81
83
let n = res?;
82
84
debug ! ( "{}: after read, {} bytes" , dbg_name, n) ;
@@ -90,7 +92,9 @@ async fn copy<A: Endpoint<A>, B: Endpoint<B>>(
90
92
// into the full `Vec<u8>`
91
93
debug ! ( "{}: before write" , dbg_name) ;
92
94
let retval = to. write ( buf_read. slice ( ..n) ) . submit ( ) ;
93
- let ( res, buf_write) = timeout ( READ_TIMEOUT , retval) . await ?;
95
+ let ( res, buf_write) = timeout ( READ_TIMEOUT , retval)
96
+ . await
97
+ . map_err ( |e| -> String { format ! ( "{} write: {}" , dbg_name, e) } ) ?;
94
98
let n = res?;
95
99
debug ! ( "{}: after write, {} bytes" , dbg_name, n) ;
96
100
// Increment byte counters for statistics
0 commit comments