Example usage for com.google.api.client.googleapis.json GoogleJsonResponseException from

List of usage examples for com.google.api.client.googleapis.json GoogleJsonResponseException from

Introduction

In this page you can find the example usage for com.google.api.client.googleapis.json GoogleJsonResponseException from.

Prototype

public static GoogleJsonResponseException from(JsonFactory jsonFactory, HttpResponse response) 

Source Link

Document

Returns a new instance of GoogleJsonResponseException .

Usage

From source file:google.registry.keyring.kms.GoogleJsonResponseExceptionHelper.java

License:Open Source License

/**
 * @param statusCode the status code that should be in the returned {@link
 *     GoogleJsonResponseException}//from w  ww .j  a v  a 2 s.c  o m
 * @return a {@link GoogleJsonResponseException} with the status code {@code statusCode}
 * @throws IOException shouldn't occur
 */
public static GoogleJsonResponseException create(int statusCode) throws IOException {
    HttpResponse response = createHttpResponse(statusCode, null);
    return GoogleJsonResponseException.from(new JacksonFactory(), response);
}