diff --git a/scm-webapp/src/main/java/sonia/scm/schedule/CronThreadFactory.java b/scm-webapp/src/main/java/sonia/scm/schedule/CronThreadFactory.java index f4f77d1c3e..6519f500fa 100644 --- a/scm-webapp/src/main/java/sonia/scm/schedule/CronThreadFactory.java +++ b/scm-webapp/src/main/java/sonia/scm/schedule/CronThreadFactory.java @@ -30,8 +30,11 @@ class CronThreadFactory implements ThreadFactory, AutoCloseable { ThreadContext.remove(); return new Thread(r, createName()); }).get(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException("failed to schedule runnable"); + } catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + throw new IllegalStateException("failed to schedule runnable"); + } catch (ExecutionException ex) { + throw new IllegalStateException("failed to schedule runnable"); } }