Issue 471: revised to include java context on interrupted errors

This commit is contained in:
Adrian Cole 2011-04-01 19:38:45 -07:00
parent 54ea98ba49
commit 72768c206d
3 changed files with 13 additions and 7 deletions

View File

@ -248,7 +248,7 @@ public class HttpRequest extends HttpMessage {
@Override
public String toString() {
return "[method=" + method + ", endpoint=" + endpoint + ", headers=" + headers + ", payload=" + payload + "]";
return String.format("[method=%s, endpoint=%s, headers=%s, payload=%s]", method, endpoint, headers, payload);
}
}

View File

@ -27,6 +27,7 @@ import javax.annotation.Resource;
import javax.inject.Inject;
import org.jclouds.logging.Logger;
import org.jclouds.rest.internal.GeneratedHttpRequest;
import com.google.common.base.Function;
import com.google.common.util.concurrent.ListenableFuture;
@ -146,6 +147,11 @@ public class TransformingHttpCommandImpl<T> implements TransformingHttpCommand<T
@Override
public String toString() {
if (request instanceof GeneratedHttpRequest<?>)
return String.format("[method=%s.%s, request=%s]", GeneratedHttpRequest.class.cast(request).getDeclaring()
.getSimpleName(), GeneratedHttpRequest.class.cast(request).getJavaMethod().getName(), request
.getRequestLine());
else
return "[request=" + request.getRequestLine() + "]";
}

View File

@ -205,7 +205,7 @@ public abstract class BaseHttpCommandExecutorService<Q> implements HttpCommandEx
@Override
public String toString() {
return "[command=" + command + "]";
return command.toString();
}
}