Github user dimas-b commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/899#discussion_r206540558 --- Diff: gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java --- @@ -222,9 +223,33 @@ protected AbstractEvalOpProcessor(final boolean manageTransactions) { * script evaluation. * @param bindingsSupplier A function that returns the {@link Bindings} to provide to the * {@link GremlinExecutor#eval} method. + * @see #evalOpInternal(ResponseHandlerContext, Supplier, BindingSupplier) */ protected void evalOpInternal(final Context context, final Supplier<GremlinExecutor> gremlinExecutorSupplier, final BindingSupplier bindingsSupplier) throws OpProcessorException { + ResponseHandlerContext rhc = new ResponseHandlerContext(context); + try { + evalOpInternal(rhc, gremlinExecutorSupplier, bindingsSupplier); + } catch (Exception ex) { + // Exceptions may occur on after the script started executing, therefore corresponding errors must be + // reported via the ResponseHandlerContext. + logger.warn("Unable to process script evaluation request: " + ex, ex); + rhc.writeAndFlush(ResponseMessage.build(context.getRequestMessage()) + .code(ResponseStatusCode.SERVER_ERROR) + .statusAttributeException(ex) + .statusMessage(ex.getMessage()).create()); + } + } + + /** + * A variant of {@link #evalOpInternal(Context, Supplier, BindingSupplier)} that is suitable for use in situations + * when multiple threads may produce {@link ResponseStatusCode#isFinalResponse() final} response messages --- End diff -- I actually intended it to be this way to create a hyperlink for the word "final" pointing to the "isFinalResponse()" method. Would you prefer to have the link named the same as the target method?
---