Skip to content

Commit

Permalink
Returning UncheckedIOException instead of RuntimeException. (Azure#20568
Browse files Browse the repository at this point in the history
)
  • Loading branch information
conniey authored Apr 12, 2021
1 parent 2f142b2 commit 4006a2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.io.UncheckedIOException;
import java.util.function.Supplier;

/**
Expand All @@ -32,6 +33,9 @@ public interface AmqpReceiveLink extends AmqpLink {
* allow the receiver to receive {@code credits} more deliveries.
*
* @param credits Number of credits to add to the receive link.
*
* @throws IllegalStateException if adding credits to a closed link.
* @throws UncheckedIOException if the work could not be scheduled on the receive link.
*/
Mono<Void> addCredits(int credits);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import reactor.core.scheduler.Schedulers;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.Objects;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.atomic.AtomicBoolean;
Expand Down Expand Up @@ -181,7 +182,7 @@ public Mono<Void> addCredits(int credits) {
sink.success();
});
} catch (IOException e) {
sink.error(new RuntimeException(String.format(
sink.error(new UncheckedIOException(String.format(
"connectionId[%s] linkName[%s] Unable to schedule work to add more credits.",
handler.getConnectionId(), getLinkName()), e));
}
Expand Down

0 comments on commit 4006a2b

Please sign in to comment.