> +/**
> + * This will parse and set an appropriate exception on the command object.
> + */
> +@Singleton
> +public class GoogleCloudStorageErrorHandler implements HttpErrorHandler {
> +   public void handleError(HttpCommand command, HttpResponse response) {
> +      // it is important to always read fully and close streams
> +      byte[] data = closeClientButKeepContentStream(response);
> +      String message = data != null ? new String(data) : null;
> +
> +      Exception exception = message != null ? new 
> HttpResponseException(command, response, message)
> +              : new HttpResponseException(command, response);
> +      message = message != null ? message : String.format("%s -> %s", 
> command.getCurrentRequest().getRequestLine(),
> +              response.getStatusLine());
> +      switch (response.getStatusCode()) {
> +         case 400:

Remove this case if you're not going to handle it.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/33/files#r14908816

Reply via email to