@@ -298,18 +298,20 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
298
298
}
299
299
300
300
// Attempt to load the file from the database
301
- let file = if let Ok ( file) = File :: from_path ( & storage, & path, & config) {
302
- file
303
- } else {
304
- // If it fails, we try again with /index.html at the end
305
- path. push_str ( "/index.html" ) ;
306
- req_path. push ( "index.html" ) ;
307
-
308
- return if ctry ! ( req, storage. exists( & path) ) {
309
- redirect ( & name, & version, & req_path[ 3 ..] )
310
- } else {
311
- Err ( IronError :: new ( Nope :: ResourceNotFound , status:: NotFound ) )
312
- } ;
301
+ let file = match File :: from_path ( & storage, & path, & config) {
302
+ Ok ( file) => file,
303
+ Err ( err) => {
304
+ log:: debug!( "got error serving {}: {}" , path, err) ;
305
+ // If it fails, we try again with /index.html at the end
306
+ path. push_str ( "/index.html" ) ;
307
+ req_path. push ( "index.html" ) ;
308
+
309
+ return if ctry ! ( req, storage. exists( & path) ) {
310
+ redirect ( & name, & version, & req_path[ 3 ..] )
311
+ } else {
312
+ Err ( IronError :: new ( Nope :: ResourceNotFound , status:: NotFound ) )
313
+ } ;
314
+ }
313
315
} ;
314
316
315
317
// Serve non-html files directly
0 commit comments