Changeset 18532 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2022-08-12T00:01:15+02:00 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r18283 r18532 13 13 import java.net.HttpURLConnection; 14 14 import java.net.MalformedURLException; 15 import java.net.NoRouteToHostException; 16 import java.net.PortUnreachableException; 17 import java.net.SocketException; 15 18 import java.net.SocketTimeoutException; 16 19 import java.net.URL; … … 769 772 throw new OsmApiException(retCode, errorHeader, errorBody); 770 773 } 771 } catch (SocketTimeoutException | ConnectException e) { 772 if (retries-- > 0) { 774 } catch (SocketException | SocketTimeoutException e) { 775 /* 776 * See #22160. While it is only thrown once in JDK sources, it does have subclasses. 777 * We check for those first, the explicit non-child exception, and then for the message. 778 */ 779 boolean validException = e instanceof SocketTimeoutException 780 || e instanceof ConnectException 781 || e instanceof NoRouteToHostException 782 || e instanceof PortUnreachableException 783 || (e.getClass().equals(SocketException.class) && 784 "Unexpected end of file from server".equals(e.getMessage())); 785 if (retries-- > 0 && validException) { 773 786 continue; 774 787 }
Note:
See TracChangeset
for help on using the changeset viewer.