Changeset 6523 in josm for trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
- Timestamp:
- 2013-12-24T20:26:51+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
r6348 r6523 12 12 import java.net.URI; 13 13 import java.util.Collections; 14 import java.util.HashSet; 14 15 import java.util.List; 16 import java.util.Set; 17 import java.util.TreeSet; 15 18 16 19 import org.openstreetmap.josm.Main; … … 56 59 private InetSocketAddress socksProxySocketAddress; 57 60 private ProxySelector delegate; 61 62 private final Set<String> errorResources = new HashSet<String>(); 63 private final Set<String> errorMessages = new HashSet<String>(); 58 64 59 65 /** … … 134 140 public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { 135 141 // Just log something. The network stack will also throw an exception which will be caught somewhere else 136 //137 142 Main.error(tr("Connection to proxy ''{0}'' for URI ''{1}'' failed. Exception was: {2}", sa.toString(), uri.toString(), ioe.toString())); 143 // Remember errors to give a friendly user message asking to review proxy configuration 144 errorResources.add(uri.toString()); 145 errorMessages.add(ioe.toString()); 146 } 147 148 /** 149 * Returns the set of current proxy resources that failed to be retrieved. 150 * @return the set of current proxy resources that failed to be retrieved 151 * @since 6523 152 */ 153 public final Set<String> getErrorResources() { 154 return new TreeSet<String>(errorResources); 155 } 156 157 /** 158 * Returns the set of current proxy error messages. 159 * @return the set of current proxy error messages 160 * @since 6523 161 */ 162 public final Set<String> getErrorMessages() { 163 return new TreeSet<String>(errorMessages); 164 } 165 166 /** 167 * Clear the sets of failed resources and error messages. 168 * @since 6523 169 */ 170 public final void clearErrors() { 171 errorResources.clear(); 172 errorMessages.clear(); 173 } 174 175 /** 176 * Determines if proxy errors have occured. 177 * @return {@code true} if errors have occured, {@code false} otherwise. 178 * @since 6523 179 */ 180 public final boolean hasErrors() { 181 return !errorResources.isEmpty(); 138 182 } 139 183
Note:
See TracChangeset
for help on using the changeset viewer.