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.
This commit is contained in:
2026-03-14 12:06:02 -04:00
parent 21ea71e257
commit ac8cbb3296
+2 -2
View File
@@ -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(),
})
}