summaryrefslogtreecommitdiffstats
path: root/vespa-http-client
diff options
context:
space:
mode:
authorHaakon Dybdahl <dybdahl@yahoo-inc.com>2016-08-08 14:45:31 +0200
committerHaakon Dybdahl <dybdahl@yahoo-inc.com>2016-08-08 14:45:31 +0200
commit07a0f739192818453a149f147f92077dc4ee2464 (patch)
tree7fa1c2944843f9dbc47ab40b93e267401a4f0893 /vespa-http-client
parente4de48dc7ba44c9066c56d7a0bbc6174f2ba4ca1 (diff)
Catch more errors.
Diffstat (limited to 'vespa-http-client')
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/IOThread.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/IOThread.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/IOThread.java
index b0bfc5b0ac2..bc41e74c36d 100644
--- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/IOThread.java
+++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/IOThread.java
@@ -310,9 +310,10 @@ class IOThread implements Runnable, AutoCloseable {
return ThreadState.DISCONNECTED;
}
return ThreadState.CONNECTED;
- } catch (Exception ex) {
+ } catch (Throwable throwable1) {
drainFirstDocumentInQueueIfOld();
- log.log(Level.WARNING, "Connect did not work out " + endpoint, ex);
+ log.log(Level.WARNING, "Connect did not work out " + endpoint, throwable1);
+ executeProblemsCounter.incrementAndGet();
return ThreadState.DISCONNECTED;
}
case CONNECTED:
@@ -320,11 +321,13 @@ class IOThread implements Runnable, AutoCloseable {
client.handshake();
successfullHandshakes.getAndIncrement();
} catch (ServerResponseException ser) {
+ executeProblemsCounter.incrementAndGet();
log.log(Level.WARNING, "Handshake did not work out " + endpoint, ser.getMessage());
drainFirstDocumentInQueueIfOld();
return ThreadState.CONNECTED;
- } catch (Exception ex) { // This cover IOException as well
- log.log(Level.WARNING, "Problem with Handshake " + endpoint, ex.getMessage());
+ } catch (Throwable throwable) { // This cover IOException as well
+ executeProblemsCounter.incrementAndGet();
+ log.log(Level.WARNING, "Problem with Handshake " + endpoint, throwable.getMessage());
drainFirstDocumentInQueueIfOld();
client.close();
return ThreadState.DISCONNECTED;