Skip to content

Commit f364a37

Browse files
author
Vivek Krishnan
committed
Expanded ternary operator on Line 260 into if then else
1 parent 3202db1 commit f364a37

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/HttpGremlinEndpointHandler.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,12 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) {
252252
}
253253
}));
254254

255-
evalFuture.exceptionally(t -> {
256-
257-
String errorMessage = (t.getMessage() != null) ? t.getMessage() :
258-
String.format("Error encountered evaluating script: %s", requestArguments.getValue0());
259-
sendError(ctx, INTERNAL_SERVER_ERROR, errorMessage, Optional.of(t));
255+
evalFuture.exceptionally(t -> {
256+
if (t.getMessage() != null)
257+
sendError(ctx, INTERNAL_SERVER_ERROR, t.getMessage(), Optional.of(t));
258+
else
259+
sendError(ctx, INTERNAL_SERVER_ERROR, String.format("Error encountered evaluating script: %s", requestArguments.getValue0())
260+
, Optional.of(t));
260261
promise.setFailure(t);
261262
return null;
262263
});
@@ -460,7 +461,6 @@ private static void sendError(final ChannelHandlerContext ctx, final HttpRespons
460461
node.put("Exception-Class", t.get().getClass().getName());
461462
}
462463

463-
464464
final FullHttpResponse response = new DefaultFullHttpResponse(
465465
HTTP_1_1, status, Unpooled.copiedBuffer(node.toString(), CharsetUtil.UTF_8));
466466
response.headers().set(CONTENT_TYPE, "application/json");

0 commit comments

Comments
 (0)