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 and vaadin-bot committed May 13, 2022
1 parent 94fa5fe commit c4ab1bd
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,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 @@ -2074,6 +2075,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 c4ab1bd

Please sign in to comment.