gmailMessage.getId(), new ModifyMessageRequest().setAddLabelIds(missingLabelIds)) .queue(relabelBatch, new JsonBatchCallback<Message>() { @Override public void onFailure(
request.queue(batches.thisBatch, callback);
@Override public void onFailure( GoogleJsonError e, HttpHeaders responseHeaders) throws IOException { System.err.format("For message: %s, got error: %s\n", message.getId(), e.toPrettyString()); if (e.getCode() == TOO_MANY_CONCURRENT_REQUESTS_FOR_USER) { request.queue(batches.nextBatch, this); } }