boolean handled = task.handleTimeoutException(); if (!handled) { log.error("Unhandled timeout exception in background task. Task: " + task.toString());
@Override public boolean handleTimeoutException() { boolean handled = wrappedTask.handleTimeoutException(); if (handled || wrappedTask.getOwnerScreen() == null) { Screens screens = getScreenContext().getScreens(); screens.remove(screen); } else { Screens screens = getScreenContext().getScreens(); screens.remove(screen); Notifications notifications = getScreenContext().getNotifications(); Messages messages = AppBeans.get(Messages.NAME); notifications.create(Notifications.NotificationType.WARNING) .withCaption(messages.getMessage(LocalizedTaskWrapper.class, "backgroundWorkProgress.timeout")) .withDescription(messages.getMessage(LocalizedTaskWrapper.class, "backgroundWorkProgress.timeoutMessage")) .show(); handled = true; } return handled; }