diff --git a/internal/handler/insightsFactsParserFilter.go b/internal/handler/insightsFactsParserFilter.go index 885e07e..667569c 100644 --- a/internal/handler/insightsFactsParserFilter.go +++ b/internal/handler/insightsFactsParserFilter.go @@ -53,7 +53,7 @@ func processFactsFromJSON(logger *slog.Logger, facts []byte, source string) []La err := json.Unmarshal(facts, &factsPayload) if err != nil { logger.Error(err.Error()) - panic("Can't unmarshal facts") + return nil } if len(factsPayload.Facts) == 0 { diff --git a/internal/handler/insightsParserFilter.go b/internal/handler/insightsParserFilter.go index 70950f9..32689d9 100644 --- a/internal/handler/insightsParserFilter.go +++ b/internal/handler/insightsParserFilter.go @@ -54,7 +54,8 @@ func processSbomInsightsData(h *Messaging, insights InsightsData, v string, apiC decoder := cdx.NewBOMDecoder(bytes.NewReader(b), cdx.BOMFileFormatJSON) if err = decoder.Decode(bom); err != nil { - panic(err) + logger.Error(err.Error()) + return nil, "", mErr } }