Skip to content

Commit f8f4b49

Browse files
MappingSubscriber should halt upon any Exception (#4205)
* MappingSubscriber should halt upon any Exception Catching only RuntimeException means anything awaiting a result from a Publisher will hang indefinitely, even after a coroutine has ended exceptionally. * Update MappingSubscriber.java --------- Co-authored-by: Debora N. Ito <476307+debora-ito@users.noreply.github.com>
1 parent d993e79 commit f8f4b49

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

utils/src/main/java/software/amazon/awssdk/utils/internal/MappingSubscriber.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void onNext(T t) {
7373
if (!isCancelled) {
7474
try {
7575
delegateSubscriber.onNext(mapFunction.apply(t));
76-
} catch (RuntimeException e) {
76+
} catch (Throwable e) {
7777
// If the map function throws an exception, the subscription should be cancelled as the publisher will
7878
// otherwise not be aware it has happened and should have the opportunity to clean up resources.
7979
cancelSubscriptions();

0 commit comments

Comments
 (0)