Changeset 8510 in josm for trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
- Timestamp:
- 2015-06-20T23:42:21+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r8509 r8510 126 126 try { 127 127 url = new URL(urlStr.replace(" ", "%20")); 128 } catch (MalformedURLException e) {128 } catch (MalformedURLException e) { 129 129 throw new OsmTransferException(e); 130 130 } … … 132 132 // fix #7640, see http://www.tikalk.com/java/forums/httpurlconnection-disable-keep-alive 133 133 activeConnection = Utils.openHttpConnection(url, false); 134 } catch (Exception e) {134 } catch (Exception e) { 135 135 throw new OsmTransferException(tr("Failed to open connection to API {0}.", url.toExternalForm()), e); 136 136 } … … 149 149 } 150 150 151 activeConnection.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect", 15)*1000);151 activeConnection.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect", 15)*1000); 152 152 153 153 try { … … 170 170 } 171 171 if (activeConnection.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) 172 throw new OsmApiException(HttpURLConnection.HTTP_UNAUTHORIZED, null,null);172 throw new OsmApiException(HttpURLConnection.HTTP_UNAUTHORIZED, null, null); 173 173 174 174 if (activeConnection.getResponseCode() == HttpURLConnection.HTTP_PROXY_AUTH) … … 184 184 BufferedReader in = new BufferedReader(new InputStreamReader(i, StandardCharsets.UTF_8)); 185 185 String s; 186 while ((s = in.readLine()) != null) {186 while ((s = in.readLine()) != null) { 187 187 errorBody.append(s); 188 188 errorBody.append('\n'); 189 189 } 190 190 } 191 } catch (Exception e) {191 } catch (Exception e) { 192 192 errorBody.append(tr("Reading error text failed.")); 193 193 }
Note:
See TracChangeset
for help on using the changeset viewer.