Skip to content

Commit

Permalink
Log errors thrown by implementations (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindgamesnl authored Nov 10, 2023
1 parent 6b5546f commit caa3a38
Showing 1 changed file with 5 additions and 2 deletions.
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

0 comments on commit caa3a38

Please sign in to comment.