diff options
author | Haakon Dybdahl <dybdahl@yahoo-inc.com> | 2017-02-28 15:17:17 +0100 |
---|---|---|
committer | Haakon Dybdahl <dybdahl@yahoo-inc.com> | 2017-02-28 15:17:17 +0100 |
commit | 50b03d68dcaaad102d5a8f4c3f762bf246f61357 (patch) | |
tree | bd2b7a666fc8a8e642c33f413981d82b836e6a66 /vespa-http-client | |
parent | 3bbcf92dcc6c90df8d7a9899e267a097ec51c2a2 (diff) |
Improve log message by transforming back to an exception that is more understandable.
Diffstat (limited to 'vespa-http-client')
-rw-r--r-- | vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java index 6fae0765e14..c469b902ed2 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java @@ -268,9 +268,13 @@ class ApacheGatewayConnection implements GatewayConnection { private void verifyServerResponseCode(StatusLine statusLine) throws ServerResponseException { // We use code 261-299 to report errors related to internal transitive errors that the tenants should not care // about to avoid masking more serious errors. - if (statusLine.getStatusCode() > 199 && statusLine.getStatusCode() < 260) { + int statusCode = statusLine.getStatusCode(); + if (statusCode > 199 && statusCode < 260) { return; } + if (statusCode == 299) { + throw new ServerResponseException(429, "Too many requests."); + } throw new ServerResponseException(statusLine.getStatusCode(), statusLine.getReasonPhrase()); } |