nacx commented on this pull request.


> @@ -50,7 +51,11 @@ public void handleError(HttpCommand command, HttpResponse 
> response) {
             break;
          case 401:
          case 403:
-            exception = new AuthorizationException(message, exception);
+            if (message.contains("\"Code\":\"DependencyViolation\"")) {

This looks very flaky. What if there is a space between the field name and the 
value? (as i the examples you copied). We need to do this better.

> @@ -50,7 +51,11 @@ public void handleError(HttpCommand command, HttpResponse 
> response) {
             break;
          case 401:
          case 403:
-            exception = new AuthorizationException(message, exception);
+            if (message.contains("\"Code\":\"DependencyViolation\"")) {

This is also going to fail. Have you really tried this?
The message variable is built by reading the payload (the payload's 
InputStream), but in order to determine if the error is a dependency violation, 
you are already consuming that InputStream (you read the body) in the retry 
handler, so at this point, the message will probably be `null`.
As I already commented to you, if you read the body in a retry handler you need 
to take care of buffering the payload in memory so it can be read again later 
when needed, or make sure all retry & error handlers that may come next never 
try to read the body.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/443#pullrequestreview-145564798

Reply via email to