@@ -259,16 +259,33 @@ async fn handle_blob_response(
259
259
mut blob_error_tx : Sender < ( String , String ) > , content_type : String , url : String ,
260
260
known_blobs : & HashMap < String , String > , duplicate : usize ) {
261
261
262
- handle_blob_response_paging ( & resp, blobs_tx, status_tx. clone ( ) ,
263
- content_type. clone ( ) ) . await ;
264
- match resp. json :: < Vec < HashMap < String , Value > > > ( ) . await {
265
- Ok ( i) => {
266
- handle_blob_response_content_uris ( status_tx, content_tx, content_type, i, known_blobs,
267
- duplicate)
268
- . await ;
262
+ handle_blob_response_paging ( & resp, blobs_tx, status_tx. clone ( ) , content_type. clone ( ) ) . await ;
263
+
264
+ match resp. text ( ) . await {
265
+ Ok ( text) => {
266
+ match serde_json:: from_str :: < Vec < HashMap < String , Value > > > ( text. as_str ( ) ) {
267
+ Ok ( i) => {
268
+ handle_blob_response_content_uris ( status_tx, content_tx, content_type, i, known_blobs,
269
+ duplicate)
270
+ . await ;
271
+ } ,
272
+ Err ( e) => {
273
+ warn ! ( "Error getting blob JSON {}" , e) ;
274
+ debug ! ( "Errored blob json content: {}" , text) ;
275
+ match blob_error_tx. send ( ( content_type, url) ) . await {
276
+ Err ( e) => {
277
+ error ! ( "Could not resend failed blob, dropping it: {}" , e) ;
278
+ status_tx. send ( StatusMessage :: ErrorContentBlob ) . await . unwrap_or_else (
279
+ |e| panic ! ( "Could not send status update, channel closed?: {}" , e)
280
+ ) ;
281
+ } ,
282
+ _=> ( ) ,
283
+ }
284
+ }
285
+ }
269
286
} ,
270
287
Err ( e) => {
271
- warn ! ( "Error getting blob JSON {}" , e) ;
288
+ warn ! ( "Error getting blob response text {}" , e) ;
272
289
match blob_error_tx. send ( ( content_type, url) ) . await {
273
290
Err ( e) => {
274
291
error ! ( "Could not resend failed blob, dropping it: {}" , e) ;
0 commit comments