From b32fc0c35fc3f4d7d1060c9d78b67e33167ed92c Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 16 Oct 2016 16:38:28 +0800 Subject: [PATCH] Avoid unnecessary error messages --- source/net/filebot/ui/rename/AutoDetectMatcher.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/net/filebot/ui/rename/AutoDetectMatcher.java b/source/net/filebot/ui/rename/AutoDetectMatcher.java index 01ee09a2..f131bc26 100644 --- a/source/net/filebot/ui/rename/AutoDetectMatcher.java +++ b/source/net/filebot/ui/rename/AutoDetectMatcher.java @@ -1,6 +1,7 @@ package net.filebot.ui.rename; +import static net.filebot.util.ExceptionUtilities.*; import static java.util.Collections.*; import static java.util.Comparator.*; import static java.util.stream.Collectors.*; @@ -16,6 +17,7 @@ import java.util.Locale; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; @@ -51,7 +53,9 @@ class AutoDetectMatcher implements AutoCompleteMatcher { try { return it.getValue().get().stream(); } catch (Exception e) { - log.log(Level.WARNING, "Failed group: " + it.getKey(), e); + if (findCause(e, CancellationException.class) == null) { + log.log(Level.WARNING, "Failed group: " + it.getKey(), e); + } return Stream.empty(); } }).sorted(comparing(Match::getValue, OriginalOrder.of(files))).collect(toList());