Skip to content

Commit 5cb6da0

Browse files
committed
Log if exception occurs
1 parent b68d8fe commit 5cb6da0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/io/eigr/spawn/internal/handlers/ActorServiceHandler.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public ActorServiceHandler(final String system, final List<Entity> actors) {
5555
@Override
5656
public void handle(HttpExchange exchange) throws IOException {
5757
log.debug("Received Actor Action Request. Exchange: {}", exchange);
58+
log.debug("Received Actor Action Request. RequestMethod: {}", exchange.getRequestMethod());
59+
5860

5961
if ("POST".equals(exchange.getRequestMethod())) {
6062
Protocol.ActorInvocationResponse response = handleRequest(exchange);
@@ -101,8 +103,11 @@ private Protocol.ActorInvocationResponse handleRequest(HttpExchange exchange) th
101103
.build();
102104
}
103105

104-
throw new ActorInvokeException("Action result is null");
106+
} catch (Exception e) {
107+
log.error("Error during handle request. Error: {}", e);
105108
}
109+
110+
throw new ActorInvokeException("Action result is null");
106111
}
107112

108113
private Optional<Value> callAction(String system, String actor, String commandName, Any value, Protocol.Context context) {

0 commit comments

Comments
 (0)