Skip to content

Commit

Permalink
Fixing exception log messaging with Prefetching (#497)
Browse files Browse the repository at this point in the history
* Changed Prefetch to catch `SdkException` instead of `SdkClientException`
  * With SDK 2.x service exceptions are of the type `SdkServiceException`
* Adding `*.iml` to .gitignore
  • Loading branch information
sahilpalvia authored and pfifer committed Feb 8, 2019
1 parent fd0cb8e commit 3b3998a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
target/
AwsCredentials.properties
.idea
*.iml

Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.stream.Collectors;

import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.lang3.Validate;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;

import com.google.common.annotations.VisibleForTesting;

import lombok.Data;
import lombok.NonNull;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.exception.SdkException;
import software.amazon.awssdk.services.cloudwatch.model.StandardUnit;
import software.amazon.awssdk.services.kinesis.model.ExpiredIteratorException;
import software.amazon.awssdk.services.kinesis.model.GetRecordsResponse;
Expand Down Expand Up @@ -325,7 +326,7 @@ private void makeRetrievalAttempt() {
scope.addData(EXPIRED_ITERATOR_METRIC, 1, StandardUnit.COUNT, MetricsLevel.SUMMARY);

dataFetcher.restartIterator();
} catch (SdkClientException e) {
} catch (SdkException e) {
log.error("Exception thrown while fetching records from Kinesis", e);
} catch (Throwable e) {
log.error("Unexpected exception was thrown. This could probably be an issue or a bug." +
Expand Down

0 comments on commit 3b3998a

Please sign in to comment.