Skip to content

Commit

Permalink
Don't report errors getting readme when manifest is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo157 committed Aug 10, 2023
1 parent 9d80e3c commit 7a25ea7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/web/crate_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,20 @@ impl CrateDetails {

#[fn_error_context::context("fetching readme for {} {}", self.name, self.version)]
fn fetch_readme(&self, storage: &Storage) -> anyhow::Result<Option<String>> {
let manifest = storage.fetch_source_file(
let manifest = match storage.fetch_source_file(
&self.name,
&self.version,
"Cargo.toml",
self.archive_storage,
)?;
) {
Ok(manifest) => manifest,
Err(err) if err.is::<PathNotFoundError>() => {
return Ok(None);
}
Err(err) => {
return Err(err);
}
};
let manifest = String::from_utf8(manifest.content)
.context("parsing Cargo.toml")?
.parse::<toml::Value>()
Expand Down

0 comments on commit 7a25ea7

Please sign in to comment.