PDF/XML errors are silently discarded ai:claude-sonnet-5-5 #52
Labels
No labels
nagonag
nagonag/ignore
bug
doc
duplicate
enhancement
help wanted
invalid
question
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
IUS/xr-invoiced#52
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Priority: minor
Found by a 100 Go Mistakes review (#53/#54 error handling). Verified by reading the code.
Where:
internal/xrechnung/pdf.go:50-57,75-78,internal/xrechnung/detector.go:36-38,internal/scanner/scanner.go:175-186Problem:
extractEmbeddedXMLreturnsnil, nilfor any non-context error fromExtractAttachmentsRawandcontinues on a failedio.ReadAll;IsXRechnungdrops theDetecterror (false, nil);fetchBodyreturns only the close error when both read and close fail. A corrupt/unsupported invoice is indistinguishable from "not an invoice" and nothing is logged.Fix: Log (debug/warn) or return a distinguishable "unreadable" error; use
errors.Join(readErr, closeErr)infetchBody.(co)authored by ai:claude-sonnet-5-5