internal/frontend: don't fail if module lacks readme
When extracting links, don't return an error if the module
readme isn't present.
Trust: Jonathan Amsterdam
Run-TryBot: Jonathan Amsterdam
@@ -167,15 +167,17 @@ func fetchMainDetails(ctx context.Context, ds internal.DataSource, um *internal.
// not, we will not show the module links on the unit page.
if unit.Path != unit.ModulePath && unit.IsRedistributable && experiment.IsActive(ctx, internal.ExperimentGoldmark) {
modReadme, err := ds.GetModuleReadme(ctx, unit.ModulePath, unit.Version)
- if err != nil {
+ if err != nil && !errors.Is(err, derrors.NotFound) {
return nil, err
}
+ if err == nil {
rm, err := processReadme(modReadme, um.SourceInfo)
if err != nil {
return nil, err
}
modLinks = rm.Links
}
+ }
return &MainDetails{
ExpandReadme: expandReadme,
