From ac8cbb3296bd561a305627668c211dce7209df25 Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Sat, 14 Mar 2026 12:06:02 -0400 Subject: [PATCH] fix(12-02): serialize ScanWarning.Err as string instead of error interface Go's error interface has no exported fields, so json.Marshal produced {} for the error message. Converting to string at the addWarning call site preserves the actual error text in the JSON payload. --- backend/library/metrics.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/library/metrics.go b/backend/library/metrics.go index 0aaefb1..9d552a4 100644 --- a/backend/library/metrics.go +++ b/backend/library/metrics.go @@ -79,7 +79,7 @@ type ScanProgress struct { type ScanWarning struct { FilePath string `json:"filePath"` Phase string `json:"phase"` - Err error `json:"err"` + Err string `json:"err"` } func newScanMetrics() *ScanMetrics { @@ -119,7 +119,7 @@ func (m *ScanMetrics) addWarning(filePath, phase string, err error) { m.Warnings = append(m.Warnings, ScanWarning{ FilePath: filePath, Phase: phase, - Err: err, + Err: err.Error(), }) }