public final void onFailure(GoogleJsonErrorContainer e, HttpHeaders responseHeaders) throws IOException { onFailure(e.getError(), responseHeaders); }
/** A helper that generates the error JSON payload that Google APIs produce. */ private static GoogleJsonErrorContainer errorWithReasonAndStatus(String reason, int status) { ErrorInfo info = new ErrorInfo(); info.setReason(reason); info.setDomain("global"); // GoogleJsonError contains one or more ErrorInfo objects; our utiities read the first one. GoogleJsonError error = new GoogleJsonError(); error.setErrors(ImmutableList.of(info)); error.setCode(status); error.setMessage(reason); // The actual JSON response is an error container. GoogleJsonErrorContainer container = new GoogleJsonErrorContainer(); container.setError(error); return container; }
public void onFailure(GoogleJsonErrorContainer googleJsonErrorContainer, HttpHeaders httpHeaders) throws IOException { System.err.println("Batching fails"); System.err.println(googleJsonErrorContainer.getError());