Parcourir la source

fix #2693 replace with InterruptedRuntimeException

Shinsuke Sugaya il y a 2 ans
Parent
commit
84355e91cb

+ 2 - 1
src/main/java/org/codelibs/fess/auth/chain/CommandChain.java

@@ -29,6 +29,7 @@ import java.util.List;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.codelibs.core.exception.InterruptedRuntimeException;
 import org.codelibs.core.lang.StringUtil;
 import org.codelibs.core.lang.ThreadUtil;
 import org.codelibs.fess.crawler.Constants;
@@ -147,7 +148,7 @@ public class CommandChain implements AuthenticationChain {
             if (mt != null && mt.isTeminated()) {
                 throw new CommandExecutionException("The command execution is timeout: " + String.join(" ", commands), e);
             }
-            throw new CommandExecutionException("Process terminated.", e);
+            throw new InterruptedRuntimeException(e);
         } catch (final Exception e) {
             throw new CommandExecutionException("Process terminated.", e);
         } finally {

+ 4 - 1
src/main/java/org/codelibs/fess/helper/SearchHelper.java

@@ -32,6 +32,7 @@ import javax.servlet.http.HttpServletRequest;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.codelibs.core.exception.InterruptedRuntimeException;
 import org.codelibs.core.lang.StringUtil;
 import org.codelibs.fess.Constants;
 import org.codelibs.fess.entity.QueryContext;
@@ -351,7 +352,9 @@ public class SearchHelper {
                 throw new SearchEngineClientException(response.buildFailureMessage());
             }
             return true;
-        } catch (InterruptedException | ExecutionException e) {
+        } catch (final InterruptedException e) {
+            throw new InterruptedRuntimeException(e);
+        } catch (final ExecutionException e) {
             throw new SearchEngineClientException("Failed to update bulk data.", e);
         }
     }