Skip to content

Commit e69e8d7

Browse files
Nemo157syphar
authored andcommitted
Don't report errors getting readme when manifest is missing
1 parent 98e4d48 commit e69e8d7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/web/crate_details.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,20 @@ impl CrateDetails {
241241

242242
#[fn_error_context::context("fetching readme for {} {}", self.name, self.version)]
243243
fn fetch_readme(&self, storage: &Storage) -> anyhow::Result<Option<String>> {
244-
let manifest = storage.fetch_source_file(
244+
let manifest = match storage.fetch_source_file(
245245
&self.name,
246246
&self.version,
247247
"Cargo.toml",
248248
self.archive_storage,
249-
)?;
249+
) {
250+
Ok(manifest) => manifest,
251+
Err(err) if err.is::<PathNotFoundError>() => {
252+
return Ok(None);
253+
}
254+
Err(err) => {
255+
return Err(err);
256+
}
257+
};
250258
let manifest = String::from_utf8(manifest.content)
251259
.context("parsing Cargo.toml")?
252260
.parse::<toml::Value>()

0 commit comments

Comments
 (0)