Skip to content

Commit caa3a38

Browse files
authored
Log errors thrown by implementations (#8)
1 parent 6b5546f commit caa3a38

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

meteor-core/src/main/java/dev/pixelib/meteor/core/transport/TransportHandler.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
import java.util.Collection;
1515
import java.util.concurrent.ExecutorService;
1616
import java.util.concurrent.Executors;
17+
import java.util.logging.Level;
18+
import java.util.logging.Logger;
1719

1820
public class TransportHandler implements Closeable {
1921

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

0 commit comments

Comments
 (0)