Skip to content

Instantly share code, notes, and snippets.

View skimbrel's full-sized avatar

Sam Kimbrel skimbrel

View GitHub Profile
@skimbrel
skimbrel / silly.java
Created July 23, 2015 17:34
AWS client code. Ah, yes, the "dispatch async error handler then throw the exception anyway" pattern.
public Future<DeleteMessageBatchResult> deleteMessageBatchAsync(
final DeleteMessageBatchRequest deleteMessageBatchRequest,
final AsyncHandler<DeleteMessageBatchRequest, DeleteMessageBatchResult> asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable<DeleteMessageBatchResult>() {
public DeleteMessageBatchResult call() throws Exception {
DeleteMessageBatchResult result;
try {
result = deleteMessageBatch(deleteMessageBatchRequest);
} catch (Exception ex) {