From 3a215fb792f6c1f7191cd89c36dc41c2f1f155b3 Mon Sep 17 00:00:00 2001 From: Alexey Utkin Date: Wed, 22 Jan 2020 13:20:15 +0300 Subject: [PATCH] `ProcessCanceledException` is not an error for `future` that is canceled by indicator cancellation GitOrigin-RevId: dfa84b5ce4b3226e417c2b84939fd8bd1c0e6dac --- .../progress/util/ProgressIndicatorUtils.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/progress/util/ProgressIndicatorUtils.java b/platform/platform-impl/src/com/intellij/openapi/progress/util/ProgressIndicatorUtils.java index 9d995ddb3812..c7e19085c946 100644 --- a/platform/platform-impl/src/com/intellij/openapi/progress/util/ProgressIndicatorUtils.java +++ b/platform/platform-impl/src/com/intellij/openapi/progress/util/ProgressIndicatorUtils.java @@ -320,12 +320,14 @@ public class ProgressIndicatorUtils { } catch (Throwable e) { Throwable cause = e.getCause(); - if (cause instanceof CancellationException) { - throw new ProcessCanceledException(cause); - } else { - ExceptionUtil.rethrowUnchecked(e); - throw new RuntimeException(e); + if (cause instanceof ProcessCanceledException) { + throw (ProcessCanceledException)cause; } + if (cause instanceof CancellationException) { + throw new ProcessCanceledException(cause); + } + ExceptionUtil.rethrowUnchecked(e); + throw new RuntimeException(e); } } }