@@ -540,7 +540,7 @@ pub fn retrieve_asset(
540
540
) )
541
541
}
542
542
} else {
543
- print_error_message ( & format ! ( "{} (not found)" , & url) , options) ;
543
+ print_error_message ( & format ! ( "{} (file not found)" , & url) , options) ;
544
544
545
545
// Provoke error
546
546
Err ( client. get ( "" ) . send ( ) . unwrap_err ( ) )
@@ -550,7 +550,7 @@ pub fn retrieve_asset(
550
550
551
551
if cache. is_some ( ) && cache. as_ref ( ) . unwrap ( ) . contains_key ( & cache_key) {
552
552
// URL is in cache, we get and return it
553
- print_info_message ( & format ! ( "{} (from cache)" , & url ) , options) ;
553
+ print_info_message ( & format ! ( "{} (from cache)" , & cache_key ) , options) ;
554
554
555
555
Ok ( (
556
556
cache. as_ref ( ) . unwrap ( ) . get ( & cache_key) . unwrap ( ) . 0 . to_vec ( ) ,
@@ -591,7 +591,10 @@ pub fn retrieve_asset(
591
591
match client. get ( url. as_str ( ) ) . headers ( headers) . send ( ) {
592
592
Ok ( response) => {
593
593
if !options. ignore_errors && response. status ( ) != reqwest:: StatusCode :: OK {
594
- print_error_message ( & format ! ( "{} ({})" , & url, response. status( ) ) , options) ;
594
+ print_error_message (
595
+ & format ! ( "{} ({})" , & cache_key, response. status( ) ) ,
596
+ options,
597
+ ) ;
595
598
596
599
// Provoke error
597
600
return Err ( client. get ( "" ) . send ( ) . unwrap_err ( ) ) ;
@@ -600,9 +603,12 @@ pub fn retrieve_asset(
600
603
let response_url: Url = response. url ( ) . clone ( ) ;
601
604
602
605
if url. as_str ( ) == response_url. as_str ( ) {
603
- print_info_message ( & format ! ( "{}" , & url ) , options) ;
606
+ print_info_message ( & cache_key . to_string ( ) , options) ;
604
607
} else {
605
- print_info_message ( & format ! ( "{} -> {}" , & url, & response_url) , options) ;
608
+ print_info_message (
609
+ & format ! ( "{} -> {}" , & cache_key, & response_url) ,
610
+ options,
611
+ ) ;
606
612
}
607
613
608
614
let new_cache_key: String = clean_url ( response_url. clone ( ) ) . to_string ( ) ;
@@ -641,7 +647,7 @@ pub fn retrieve_asset(
641
647
Ok ( ( data, response_url, media_type, charset) )
642
648
}
643
649
Err ( error) => {
644
- print_error_message ( & format ! ( "{} ({})" , & url , error) , options) ;
650
+ print_error_message ( & format ! ( "{} ({})" , & cache_key , error) , options) ;
645
651
646
652
Err ( client. get ( "" ) . send ( ) . unwrap_err ( ) )
647
653
}
0 commit comments