chore: log addToZip errors instead of silently dropping

This commit is contained in:
Claus Lohmar 2026-06-17 12:14:37 +00:00
parent be3aa7a036
commit 8759b31e47

View file

@ -482,13 +482,19 @@ func (h *FileHandler) StartDownloadCleanup() {
// Internal helpers
// ---------------------------------------------------------------------------
// addToZip adds a file to a zip.Writer.
// addToZip adds a file to a zip.Writer. Errors are logged but not returned
// since a missing image in the ZIP is non-fatal — the report is the priority.
func addToZip(zw *zip.Writer, name string, data []byte) {
f, err := zw.Create(name)
if err != nil {
log.Printf("WARN [%s] handlers: addToZip: create %q: %v",
time.Now().Format(time.RFC3339), name, err)
return
}
f.Write(data)
if _, err := f.Write(data); err != nil {
log.Printf("WARN [%s] handlers: addToZip: write %q: %v",
time.Now().Format(time.RFC3339), name, err)
}
}
// ---------------------------------------------------------------------------