From 83b52f9e8e30f35ea2d892a74aad1b5838ebf8b5 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 26 Sep 2024 10:11:17 +0000 Subject: [PATCH 1/3] Add renovate.json --- renovate.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..7190a60 --- /dev/null +++ b/renovate.json @@ -0,0 +1,3 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json" +} From 1449729882f146fdf454bcfeb88d42f8f4c7362b Mon Sep 17 00:00:00 2001 From: Christian Schmied Date: Fri, 27 Sep 2024 16:59:38 +0200 Subject: [PATCH 2/3] first write Error file then Move File, so the move error can also be detected while the error writing is always done first --- FileArchiver.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FileArchiver.go b/FileArchiver.go index 92da89d..ad68bc5 100644 --- a/FileArchiver.go +++ b/FileArchiver.go @@ -94,10 +94,13 @@ func moveToError(conf *Config, filePath string, archiveErr error) error { if err != nil { return err } - err = os.Rename(filePath, filepath.Join(destFolder, baseName)) err = writeErrorFile(conf, filePath, archiveErr) if err != nil { return err } + err = os.Rename(filePath, filepath.Join(destFolder, baseName)) + if err != nil { + return err + } return nil } From 76c2a7be5e5b2d6b1a4a2932707cf0de5f7cef4b Mon Sep 17 00:00:00 2001 From: Christian Schmied Date: Sat, 26 Oct 2024 19:13:32 +0200 Subject: [PATCH 3/3] fix ErrorOnlyArchiver logging Error, also when there is none --- ErrorOnlyArchiver.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ErrorOnlyArchiver.go b/ErrorOnlyArchiver.go index 20df8b1..f17bc7b 100644 --- a/ErrorOnlyArchiver.go +++ b/ErrorOnlyArchiver.go @@ -9,7 +9,9 @@ func NewErrorOnlyArchiver(conf *Config) func(string, error) { return func(filePath string, archiveErr error) { if archiveErr != nil { err := writeErrorFile(conf, filePath, archiveErr) - logger.Error(err) + if err != nil { + logger.Error(err) + } } } }