Changeset 17330 in josm for trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.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/DownloadTask.java
r13927 r17330 4 4 import java.net.URL; 5 5 import java.util.List; 6 import java.util.Objects; 6 7 import java.util.concurrent.Future; 8 import java.util.stream.Collectors; 7 9 8 10 import org.openstreetmap.josm.data.Bounds; 9 11 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 10 12 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 13 import org.openstreetmap.josm.tools.ExceptionUtil; 11 14 12 15 /** … … 116 119 117 120 /** 121 * Replies the error messages of the task. Empty list, if no error messages are available. 122 * 123 * @return the list of error messages 124 * @since 17330 125 */ 126 default List<String> getErrorMessages() { 127 return getErrorObjects().stream().map(o -> { 128 if (o instanceof String) { 129 return (String) o; 130 } else if (o instanceof Exception) { 131 return ExceptionUtil.explainException((Exception) o).replace("<html>", "").replace("</html>", ""); 132 } else { 133 return (String) null; 134 } 135 }).filter(Objects::nonNull).collect(Collectors.toList()); 136 } 137 138 /** 118 139 * Cancels the asynchronous download task. 119 140 *
Note:
See TracChangeset
for help on using the changeset viewer.