From 2c0965609d09ef68f655b6fcd3ee3ed38996ff54 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Thu, 10 Feb 2005 20:09:39 +0300 Subject: [PATCH] Need to catch exceptions that could be thrown by alarm cause failure to do so may lead to alarm thread termination and cancelling all unexecuted requests. --- openapi/src/com/intellij/util/Alarm.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openapi/src/com/intellij/util/Alarm.java b/openapi/src/com/intellij/util/Alarm.java index 685efff2e0dd..dc8c527eb578 100644 --- a/openapi/src/com/intellij/util/Alarm.java +++ b/openapi/src/com/intellij/util/Alarm.java @@ -84,7 +84,7 @@ public class Alarm { try { request.run(); } - catch (Exception e) { + catch (Throwable e) { LOG.error(e); } } @@ -223,7 +223,12 @@ public class Alarm { } } if (!isCanceled) { - request.run(); + try { + request.run(); + } + catch (Throwable e) { + LOG.error(e); + } } } };