From d42aadf9c93cf25cc315a1257450a0b9af3de722 Mon Sep 17 00:00:00 2001 From: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:00:35 +0200 Subject: [PATCH] Ignore version errors Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> --- backend/internal/moduleindex/generator.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/internal/moduleindex/generator.go b/backend/internal/moduleindex/generator.go index db142a8..8432cc2 100644 --- a/backend/internal/moduleindex/generator.go +++ b/backend/internal/moduleindex/generator.go @@ -348,7 +348,12 @@ func (g generator) generate(ctx context.Context, moduleList []module.Addr, block } for _, m := range modules.Modules { if err := m.Validate(); err != nil { - return fmt.Errorf("invalid module (%w)", err) + // We are ignoring invalid version numbers here because the dataset contains them, but when a module is + // refreshed, it should be excluded above. + var invalidVersionNumber *module.InvalidVersionNumber + if !errors.As(err, &invalidVersionNumber) { + return fmt.Errorf("invalid module (%w)", err) + } } } marshalled, err := json.Marshal(modules)