> + 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 401:
> + exception = new AuthorizationException(exception.getMessage(),
> exception);
> + break;
> + case 404:
> + Exception oldException = exception;
> + String sourcePath =
> command.getCurrentRequest().getFirstHeaderOrNull(SwiftHeaders.OBJECT_COPY_FROM);
> + if (sourcePath != null) {
> + // the path returned here is in the form
> "/v1/tenant-id/destContainer/destObject"
This code is identical to the code that already lives in Swift. :)
https://github.com/jclouds/jclouds/blob/master/apis/swift/src/main/java/org/jclouds/openstack/swift/handlers/ParseSwiftErrorFromHttpResponse.java#L63
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/79/files#r9892500