Skip to content

Commit

Permalink
Rethrows interrupt exceptions from libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
duy committed Sep 19, 2024
1 parent f6a3e4d commit ca15aac
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.apache.logging.log4j.Logger;
import org.apfloat.ApfloatInterruptedException;
import org.matheclipse.core.basic.Config;
import org.matheclipse.core.eval.exception.TimeoutException;
import org.matheclipse.core.expression.F;
import org.matheclipse.core.expression.S;
import org.matheclipse.core.interfaces.IAST;
Expand Down Expand Up @@ -851,7 +852,7 @@ public static String templateRender(String templateStr, String[] args) {


public static void rethrowsInterruptException(Exception e) {
if (e instanceof ApfloatInterruptedException || e instanceof PreemptingException) {
if (e instanceof ApfloatInterruptedException || e instanceof PreemptingException || e instanceof TimeoutException) {
throw (RuntimeException) e;
}
if (e instanceof RuntimeException && e.getCause() instanceof InterruptedException) {
Expand Down

0 comments on commit ca15aac

Please sign in to comment.