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