Changeset 9184 in josm
- Timestamp:
- 2015-12-28T00:02:30+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r9174 r9184 148 148 if (activeConnection.getResponseCode() != HttpURLConnection.HTTP_OK) { 149 149 String errorHeader = activeConnection.getHeaderField("Error"); 150 final String errorBody = activeConnection.fetchContent(); 150 String errorBody; 151 try { 152 errorBody = activeConnection.fetchContent(); 153 } catch (Exception e) { 154 errorBody = tr("Reading error text failed."); 155 } 151 156 throw new OsmApiException(activeConnection.getResponseCode(), errorHeader, errorBody, url.toString()); 152 157 } -
trunk/src/org/openstreetmap/josm/tools/HttpClient.java
r9182 r9184 104 104 try { 105 105 connection.connect(); 106 if (reasonForRequest != null && "".equalsIgnoreCase(reasonForRequest)) { 107 Main.info("{0} {1} ({2}) -> {3}", requestMethod, url, reasonForRequest, connection.getResponseCode()); 108 } else { 109 Main.info("{0} {1} -> {2}", requestMethod, url, connection.getResponseCode()); 110 } 106 final boolean hasReason = reasonForRequest != null && "".equalsIgnoreCase(reasonForRequest); 107 Main.info("{0} {1}{2} -> {3}{4}", 108 requestMethod, url, hasReason ? " (" + reasonForRequest + ")" : "", 109 connection.getResponseCode(), 110 connection.getContentLengthLong() > 0 ? " (" + connection.getContentLengthLong() / 1024 + "KB)" : "" 111 ); 111 112 if (Main.isDebugEnabled()) { 112 113 Main.debug("RESPONSE: " + connection.getHeaderFields()); 113 114 } 114 115 } catch (IOException e) { 116 Main.info("{0} {1} -> !!!", requestMethod, url); 115 117 Main.warn(e); 116 118 //noinspection ThrowableResultOfMethodCallIgnored
Note:
See TracChangeset
for help on using the changeset viewer.