|
17 | 17 | package com.arangodb.http; |
18 | 18 |
|
19 | 19 | import java.io.IOException; |
20 | | -import java.net.ConnectException; |
| 20 | +import java.net.SocketException; |
21 | 21 | import java.util.ArrayList; |
22 | 22 | import java.util.HashMap; |
23 | 23 | import java.util.List; |
@@ -95,7 +95,9 @@ public class HttpManager { |
95 | 95 | private Map<String, InvocationObject> jobs = new HashMap<String, InvocationObject>(); |
96 | 96 |
|
97 | 97 | public static enum HttpMode { |
98 | | - SYNC, ASYNC, FIREANDFORGET |
| 98 | + SYNC, |
| 99 | + ASYNC, |
| 100 | + FIREANDFORGET |
99 | 101 | } |
100 | 102 |
|
101 | 103 | public HttpManager(ArangoConfigure configure) { |
@@ -333,7 +335,7 @@ public HttpResponseEntity execute(HttpRequestEntity requestEntity) throws Arango |
333 | 335 | while (true) { |
334 | 336 | try { |
335 | 337 | return executeInternal(configure.getBaseUrl(), requestEntity); |
336 | | - } catch (ConnectException ex) { |
| 338 | + } catch (SocketException ex) { |
337 | 339 | retries++; |
338 | 340 | if (connectRetryCount > 0 && retries > connectRetryCount) { |
339 | 341 | logger.error(ex.getMessage(), ex); |
@@ -364,7 +366,7 @@ public HttpResponseEntity execute(HttpRequestEntity requestEntity) throws Arango |
364 | 366 | * @throws ArangoException |
365 | 367 | */ |
366 | 368 | private HttpResponseEntity executeInternal(String baseUrl, HttpRequestEntity requestEntity) throws ArangoException, |
367 | | - ConnectException { |
| 369 | + SocketException { |
368 | 370 |
|
369 | 371 | String url = buildUrl(baseUrl, requestEntity); |
370 | 372 |
|
@@ -500,7 +502,7 @@ private HttpResponseEntity executeInternal(String baseUrl, HttpRequestEntity req |
500 | 502 | } |
501 | 503 |
|
502 | 504 | return responseEntity; |
503 | | - } catch (ConnectException ex) { |
| 505 | + } catch (SocketException ex) { |
504 | 506 | throw ex; |
505 | 507 | } catch (ClientProtocolException e) { |
506 | 508 | throw new ArangoException(e); |
|
0 commit comments