Skip to content

Commit 4698adb

Browse files
committed
Turn off suppressed exceptions (to squash)
Signed-off-by: Rossen Stoyanchev <[email protected]>
1 parent c4f5467 commit 4698adb

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

rsocket-core/src/main/java/io/rsocket/RSocketAdapter.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,25 @@
2323
/**
2424
* Package private class with default implementations for use in {@link RSocket}. The main purpose
2525
* is to hide static {@link UnsupportedOperationException} declarations.
26+
*
27+
* @since 1.0.3
2628
*/
2729
class RSocketAdapter {
2830

2931
private static final Mono<Void> UNSUPPORTED_FIRE_AND_FORGET =
30-
Mono.error(new UnsupportedOperationException("Fire-and-Forget not implemented."));
32+
Mono.error(new UnsupportedInteractionException("Fire-and-Forget"));
3133

3234
private static final Mono<Payload> UNSUPPORTED_REQUEST_RESPONSE =
33-
Mono.error(new UnsupportedOperationException("Request-Response not implemented."));
35+
Mono.error(new UnsupportedInteractionException("Request-Response"));
3436

3537
private static final Flux<Payload> UNSUPPORTED_REQUEST_STREAM =
36-
Flux.error(new UnsupportedOperationException("Request-Stream not implemented."));
38+
Flux.error(new UnsupportedInteractionException("Request-Stream"));
3739

3840
private static final Flux<Payload> UNSUPPORTED_REQUEST_CHANNEL =
39-
Flux.error(new UnsupportedOperationException("Request-Channel not implemented."));
41+
Flux.error(new UnsupportedInteractionException("Request-Channel"));
4042

4143
private static final Mono<Void> UNSUPPORTED_METADATA_PUSH =
42-
Mono.error(new UnsupportedOperationException("Metadata-Push not implemented."));
44+
Mono.error(new UnsupportedInteractionException("Metadata-Push"));
4345

4446
static Mono<Void> fireAndForget(Payload payload) {
4547
payload.release();
@@ -64,4 +66,13 @@ static Mono<Void> metadataPush(Payload payload) {
6466
payload.release();
6567
return RSocketAdapter.UNSUPPORTED_METADATA_PUSH;
6668
}
69+
70+
private static class UnsupportedInteractionException extends RuntimeException {
71+
72+
private static final long serialVersionUID = 5084623297446471999L;
73+
74+
UnsupportedInteractionException(String interactionName) {
75+
super(interactionName + " not implemented.", null, false, false);
76+
}
77+
}
6778
}

0 commit comments

Comments
 (0)