* @throws JSONException
*/
public ListBucketsResponse listBuckets() {
HttpResponse r = helper.listBuckets();
try {
return new ListBucketsResponse(r);
} catch (JSONException e) {
try {
return new ListBucketsResponse(helper.toss(new RiakResponseRuntimeException(r, e)));
} catch (Exception e1) {
throw new IllegalStateException(
"helper.toss() returns a unsuccessful result, so BucketResponse shouldn't try to parse it or throw");
}
} catch (IOException e) {
try {
return new ListBucketsResponse(helper.toss(new RiakIORuntimeException(e)));
} catch (Exception e1) {
throw new IllegalStateException(
"helper.toss() returns a unsuccessful result, so BucketResponse shouldn't try to read it or throw");
}
}