Skip to content

Commit c7f7ecc

Browse files
committed
log error when crate documentation root not found in storage
1 parent 8f8a5f0 commit c7f7ecc

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/web/rustdoc.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use std::{
3333
collections::{BTreeMap, HashMap},
3434
sync::Arc,
3535
};
36-
use tracing::{debug, instrument, trace};
36+
use tracing::{debug, error, instrument, trace};
3737

3838
static DOC_RUST_LANG_ORG_REDIRECTS: Lazy<HashMap<&str, &str>> = Lazy::new(|| {
3939
HashMap::from([
@@ -540,6 +540,7 @@ pub(crate) async fn rustdoc_html_server_handler(
540540
let params = params.clone();
541541
let version = version.clone();
542542
let storage = storage.clone();
543+
let storage_path = storage_path.clone();
543544
move || {
544545
storage.rustdoc_file_exists(
545546
&params.name,
@@ -571,6 +572,17 @@ pub(crate) async fn rustdoc_html_server_handler(
571572
)?
572573
.into_response())
573574
} else {
575+
if storage_path == format!("{}/index.html", krate.target_name) {
576+
error!(
577+
krate = params.name,
578+
version,
579+
original_path = original_path.as_ref(),
580+
storage_path,
581+
"Couldn't find crate documentation root on storage.
582+
Something is wrong with the build."
583+
)
584+
}
585+
574586
Err(AxumNope::ResourceNotFound)
575587
};
576588
}

0 commit comments

Comments
 (0)