Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ public TransportException(Throwable t) {
public synchronized Throwable fillInStackTrace() {
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package io.reactivesocket.internal;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
Expand Down Expand Up @@ -837,9 +836,8 @@ public void onNext(Frame frame) {
cancel();
} else if (type == FrameType.ERROR) {
terminated.set(true);
final ByteBuffer byteBuffer = frame.getData();
String errorMessage = getByteBufferAsString(byteBuffer);
onError(new RuntimeException(errorMessage));
Throwable throwable = Exceptions.from(frame);
onError(throwable);
cancel();
} else {
onError(new RuntimeException("Unexpected FrameType: " + frame.getType()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package io.reactivesocket;

import io.reactivesocket.exceptions.RejectedException;
import io.reactivesocket.internal.Publishers;
import io.reactivesocket.internal.Responder;
import org.junit.After;
Expand Down Expand Up @@ -182,7 +183,7 @@ public void testWriteWithoutLease() throws InterruptedException {
TestSubscriber<Payload> ts2 = new TestSubscriber<>();
response2.subscribe(ts2);
ts2.awaitTerminalEvent(500, TimeUnit.MILLISECONDS);
ts2.assertError(RuntimeException.class);
ts2.assertError(RejectedException.class);
}

@Test(timeout=2000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.reactivesocket.LatchedCompletable;
import io.reactivesocket.Payload;
import io.reactivesocket.TestConnection;
import io.reactivesocket.exceptions.InvalidRequestException;
import io.reactivesocket.util.PayloadImpl;
import io.reactivex.Observable;
import io.reactivex.subjects.ReplaySubject;
Expand Down Expand Up @@ -165,7 +166,7 @@ public void testRequestResponseError() throws InterruptedException {

conn.toInput.send(Frame.Error.from(2, new RuntimeException("Failed")));
ts.awaitTerminalEvent(500, TimeUnit.MILLISECONDS);
ts.assertError(Exception.class);
ts.assertError(InvalidRequestException.class);
assertEquals("Failed", ts.errors().get(0).getMessage());
}

Expand Down Expand Up @@ -313,7 +314,7 @@ public void testRequestStreamError() throws InterruptedException {
conn.toInput.send(utf8EncodedErrorFrame(2, "Failure"));

ts.awaitTerminalEvent(500, TimeUnit.MILLISECONDS);
ts.assertError(Exception.class);
ts.assertError(InvalidRequestException.class);
ts.assertValue(utf8EncodedPayload("hello", null));
assertEquals("Failure", ts.errors().get(0).getMessage());
}
Expand Down