@@ -540,7 +540,7 @@ pub fn retrieve_asset(
540540 ) )
541541 }
542542 } else {
543- print_error_message ( & format ! ( "{} (not found)" , & url) , options) ;
543+ print_error_message ( & format ! ( "{} (file not found)" , & url) , options) ;
544544
545545 // Provoke error
546546 Err ( client. get ( "" ) . send ( ) . unwrap_err ( ) )
@@ -550,7 +550,7 @@ pub fn retrieve_asset(
550550
551551 if cache. is_some ( ) && cache. as_ref ( ) . unwrap ( ) . contains_key ( & cache_key) {
552552 // 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) ;
554554
555555 Ok ( (
556556 cache. as_ref ( ) . unwrap ( ) . get ( & cache_key) . unwrap ( ) . 0 . to_vec ( ) ,
@@ -591,7 +591,10 @@ pub fn retrieve_asset(
591591 match client. get ( url. as_str ( ) ) . headers ( headers) . send ( ) {
592592 Ok ( response) => {
593593 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+ ) ;
595598
596599 // Provoke error
597600 return Err ( client. get ( "" ) . send ( ) . unwrap_err ( ) ) ;
@@ -600,9 +603,12 @@ pub fn retrieve_asset(
600603 let response_url: Url = response. url ( ) . clone ( ) ;
601604
602605 if url. as_str ( ) == response_url. as_str ( ) {
603- print_info_message ( & format ! ( "{}" , & url ) , options) ;
606+ print_info_message ( & cache_key . to_string ( ) , options) ;
604607 } else {
605- print_info_message ( & format ! ( "{} -> {}" , & url, & response_url) , options) ;
608+ print_info_message (
609+ & format ! ( "{} -> {}" , & cache_key, & response_url) ,
610+ options,
611+ ) ;
606612 }
607613
608614 let new_cache_key: String = clean_url ( response_url. clone ( ) ) . to_string ( ) ;
@@ -641,7 +647,7 @@ pub fn retrieve_asset(
641647 Ok ( ( data, response_url, media_type, charset) )
642648 }
643649 Err ( error) => {
644- print_error_message ( & format ! ( "{} ({})" , & url , error) , options) ;
650+ print_error_message ( & format ! ( "{} ({})" , & cache_key , error) , options) ;
645651
646652 Err ( client. get ( "" ) . send ( ) . unwrap_err ( ) )
647653 }
0 commit comments