mikepersonick commented on a change in pull request #1553:
URL: https://github.com/apache/tinkerpop/pull/1553#discussion_r794489192
##########
File path:
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/AndStep.java
##########
@@ -33,10 +34,18 @@ public AndStep(final Traversal.Admin traversal, final
Traversal<S, ?>... travers
@Override
protected boolean filter(final Traverser.Admin<S> traverser) {
+ GremlinTypeErrorException typeError = null;
for (final Traversal.Admin<S, ?> traversal : this.traversals) {
- if (!TraversalUtil.test(traverser, traversal))
- return false;
+ try {
+ if (!TraversalUtil.test(traverser, traversal))
+ return false;
+ } catch (GremlinTypeErrorException ex) {
+ // hold onto it until the end in case any other arguments
evaluate to FALSE
Review comment:
Check out the table in the semantics document (in this PR). There is a
description of AND/OR/XOR semantics:
`ERROR && FALSE -> FALSE`
`AND` might be wrapped by an operator that handles ERROR differently from
FALSE (e.g. `NOT`), so we need to wait on propagating the ERROR until we've
seen all the arguments.
--
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]