diff --git a/client/src/main/java/ctbrec/ui/tabs/ThumbOverviewTab.java b/client/src/main/java/ctbrec/ui/tabs/ThumbOverviewTab.java index 96edf6c1..6d69d316 100644 --- a/client/src/main/java/ctbrec/ui/tabs/ThumbOverviewTab.java +++ b/client/src/main/java/ctbrec/ui/tabs/ThumbOverviewTab.java @@ -114,6 +114,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener { private final SimpleBooleanProperty preserveAspectRatio = new SimpleBooleanProperty(true); ProgressIndicator progressIndicator; Label noResultsFound = new Label("Nothing found!"); + Label errorLabel = new Label(""); private ComboBox thumbWidth; @@ -355,8 +356,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener { gridLock.lock(); try { ObservableList nodes = grid.getChildren(); - nodes.remove(progressIndicator); - nodes.remove(noResultsFound); + nodes.removeAll(progressIndicator, noResultsFound, errorLabel); // first remove models, which are not in the updated list removeModelsMissingInUpdate(nodes, models); @@ -626,12 +626,17 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener { if (event.getSource().getException() != null) { if (event.getSource().getException() instanceof SocketTimeoutException) { LOG.debug("Fetching model list timed out"); + errorLabel.setText("Timeout while updating"); } else { LOG.error("Couldn't update model list", event.getSource().getException()); + errorLabel.setText("Error while updating " + event.getSource().getException().getLocalizedMessage()); } } else { LOG.error("Couldn't update model list {}", event.getEventType()); + errorLabel.setText("Couldn't update model list " + event.getEventType()); } + grid.getChildren().removeAll(progressIndicator, noResultsFound, errorLabel); + grid.getChildren().add(errorLabel); } void filter() { @@ -779,7 +784,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener { @Override public void selected() { - grid.getChildren().remove(noResultsFound); + grid.getChildren().removeAll(noResultsFound, errorLabel); if (grid.getChildren().isEmpty()) { grid.getChildren().add(progressIndicator); }