Skip to content

Commit

Permalink
fix: Ignore CancellationException for running UI update tasks (#13708)
Browse files Browse the repository at this point in the history
Ignore CancellationException if the task is cancelled in the meantime.
Authored-by: @HawkSK
Fixes #13610

Co-authored-by: @mshabarov
  • Loading branch information
mshabarov authored May 13, 2022
1 parent 3512997 commit 6fa9556
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.Optional;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Future;
Expand Down Expand Up @@ -2059,6 +2060,10 @@ public void runPendingAccessTasks(VaadinSession session) {
try {
pendingAccess.get();

} catch (CancellationException ignored) { // NOSONAR
// Ignore canceled UI access tasks exceptions and don't
// let it to be processed by the error handler and shown
// on the UI
} catch (Exception exception) {
pendingAccess.handleError(exception);
}
Expand Down

0 comments on commit 6fa9556

Please sign in to comment.