diff --git a/changelog/unreleased/issue-3861 b/changelog/unreleased/issue-3861
index 3d399df0b..501f6c83b 100644
--- a/changelog/unreleased/issue-3861
+++ b/changelog/unreleased/issue-3861
@@ -6,3 +6,4 @@ units in the duration options, such as e.g. `--keep-within-daily 2w`.
 Specifying an invalid/unsupported duration unit now results in an error.
 
 https://github.com/restic/restic/issues/3861
+https://github.com/restic/restic/pull/3862
diff --git a/internal/restic/duration_test.go b/internal/restic/duration_test.go
index b46fc66be..f03aa5553 100644
--- a/internal/restic/duration_test.go
+++ b/internal/restic/duration_test.go
@@ -83,8 +83,14 @@ func TestParseDuration(t *testing.T) {
 	for _, test := range tests {
 		t.Run("", func(t *testing.T) {
 			d, err := ParseDuration(test.input)
-			if err != nil && !test.err {
-				t.Fatal(err)
+			if test.err {
+				if err == nil {
+					t.Fatalf("Missing error for %v", test.input)
+				}
+			} else {
+				if err != nil {
+					t.Fatal(err)
+				}
 			}
 
 			if !cmp.Equal(d, test.d) {