From 4460aa3458abcd6ba147dbbdc5444d56c57259fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Fran=C3=A7ois=20CASSAN?= Date: Sun, 14 Jul 2024 04:23:24 -0300 Subject: [PATCH] clarify error message when a zip file is corrupted (#374) * Clarify the error message when a zip file is corrupted. Fixes #357 --- docs/releases.md | 1 + helpers/fshelper/parseArgs.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/releases.md b/docs/releases.md index c551a5db..10a1fab7 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -25,6 +25,7 @@ fixes: - [#299](https://github.com/simulot/immich-go/issues/299) Real time GUI log only shows 4 lines #299 - [#370](https://github.com/simulot/immich-go/issues/370) ui: clearly mention when the upload in completed - [#232](https://github.com/simulot/immich-go/issues/232) Exclude based on filename / glob +- [#357](https://github.com/simulot/immich-go/issues/357) clarify error message when a zip file is corrupted ## Release 0.19.1 diff --git a/helpers/fshelper/parseArgs.go b/helpers/fshelper/parseArgs.go index 65cec863..fff24059 100644 --- a/helpers/fshelper/parseArgs.go +++ b/helpers/fshelper/parseArgs.go @@ -29,13 +29,13 @@ func ParsePath(args []string, googlePhoto bool) ([]fs.FS, error) { case strings.HasSuffix(lowA, ".zip"): files, err := expandNames(a) if err != nil { - errs = errors.Join(errs, err) + errs = errors.Join(errs, fmt.Errorf("%s: %w", a, err)) break } for _, f := range files { fsys, err := zip.OpenReader(f) if err != nil { - errs = errors.Join(errs, err) + errs = errors.Join(errs, fmt.Errorf("%s: %w", a, err)) continue } fsyss = append(fsyss, fsys)