Changeset 17330 in josm for trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
- Timestamp:
- 2020-11-22T22:54:01+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
r16770 r17330 9 9 import java.awt.geom.Area; 10 10 import java.awt.geom.Rectangle2D; 11 import java.util.ArrayList;12 11 import java.util.Collection; 13 12 import java.util.LinkedHashSet; … … 35 34 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 36 35 import org.openstreetmap.josm.gui.util.GuiHelper; 37 import org.openstreetmap.josm.tools.ExceptionUtil;38 36 import org.openstreetmap.josm.tools.ImageProvider; 39 37 import org.openstreetmap.josm.tools.Logging; … … 247 245 } 248 246 } 249 Set< Object> errors = tasks.stream().flatMap(t -> t.getErrorObjects().stream()).collect(Collectors.toSet());247 Set<String> errors = tasks.stream().flatMap(t -> t.getErrorMessages().stream()).collect(Collectors.toSet()); 250 248 if (!errors.isEmpty()) { 251 final Collection<String> items = new ArrayList<>();252 for (Object error : errors) {253 if (error instanceof String) {254 items.add((String) error);255 } else if (error instanceof Exception) {256 items.add(ExceptionUtil.explainException((Exception) error));257 }258 }259 260 249 GuiHelper.runInEDT(() -> { 261 if ( items.size() == 1 && PostDownloadHandler.isNoDataErrorMessage(items.iterator().next())) {262 new Notification( items.iterator().next()).setIcon(JOptionPane.WARNING_MESSAGE).show();250 if (errors.size() == 1 && PostDownloadHandler.isNoDataErrorMessage(errors.iterator().next())) { 251 new Notification(errors.iterator().next()).setIcon(JOptionPane.WARNING_MESSAGE).show(); 263 252 } else { 264 253 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), "<html>" 265 254 + tr("The following errors occurred during mass download: {0}", 266 Utils.joinAsHtmlUnorderedList( items)) + "</html>",255 Utils.joinAsHtmlUnorderedList(errors)) + "</html>", 267 256 tr("Errors during download"), JOptionPane.ERROR_MESSAGE); 268 257 return;
Note:
See TracChangeset
for help on using the changeset viewer.