Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log errors thrown by implementations #8

Merged
merged 1 commit into from
Nov 10, 2023
Merged
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 @@ -14,9 +14,12 @@
import java.util.Collection;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.logging.Level;
import java.util.logging.Logger;

public class TransportHandler implements Closeable {

private final Logger logger = Logger.getLogger(TransportHandler.class.getSimpleName());
private final RpcSerializer serializer;
private final RpcTransport transport;
private final IncomingInvocationTracker incomingInvocationTracker;
Expand Down Expand Up @@ -91,8 +94,8 @@ private boolean handleInvocationRequest(byte[] bytes) throws ClassNotFoundExcept
Object response = matchedImplementation.invokeOn(invocationDescriptor, invocationDescriptor.getReturnType());
InvocationResponse invocationResponse = new InvocationResponse(invocationDescriptor.getUniqueInvocationId(), response);
transport.send(Direction.METHOD_PROXY, invocationResponse.toBytes(serializer));
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (Throwable e) {
logger.log(Level.SEVERE, "An error occurred while invoking a method", e);
}
});

Expand Down