divijvaidya commented on a change in pull request #1553:
URL: https://github.com/apache/tinkerpop/pull/1553#discussion_r794472972
##########
File path:
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/FilterStep.java
##########
@@ -34,9 +36,22 @@ public FilterStep(final Traversal.Admin traversal) {
@Override
protected Traverser.Admin<S> processNextStart() {
while (true) {
- final Traverser.Admin<S> traverser = this.starts.next();
- if (this.filter(traverser))
- return traverser;
+ try {
+ final Traverser.Admin<S> traverser = this.starts.next();
+ if (this.filter(traverser))
+ return traverser;
+ } catch (GremlinTypeErrorException ex) {
+ if (this instanceof BinaryReductionStep ||
getTraversal().getParent() == EmptyStep.instance()) {
Review comment:
I agree with what Mike is saying. When a traversal is executed,
exceptions are directly propagated outside to the server and from server to the
client. One option for "guaranteed-top-level" would be catching this at server
and converting to a result but I would not be in favour of that approach since
it leaks the query execution semantics to the server and introduce strong
coupling.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]