[ 
https://issues.apache.org/jira/browse/TINKERPOP-3289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yang Xia updated TINKERPOP-3289:
--------------------------------
    Description: 
 

Combining two loop termination modulators on a single repeat() produces an 
error that describes the symptom rather than the issue: 
{code:java}
gremlin> 
g.V().has('code','AGR').repeat(out()).until(has('code','CCU')).times(3).path().by('code')
The repeat()-traversal was not defined:[TinkerGraphStep(vertex,[code.eq(AGR)]), 
RepeatStep([VertexStep(OUT,vertex), 
RepeatEndStep],until([HasStep([code.eq(CCU)])]),emit(false)), 
RepeatStep(until(loops(3)),null,emit(false)), PathStep([value(code)])]
Type ':help' or ':h' for help.
Display stack trace? [yN] {code}
The message suggests the repeat() body is missing, when the actual problem is 
that times() is shorthand for until(loops). Both modulators populate the same 
slot on RepeatStep, so the second one creates a new, empty RepeatStep that is 
never given a body.

The same generic message appears for times().until(), times().times(), 
until().until() and the until-first form until(...).times().repeat(...). 
RepeatUnrollStrategy can also unroll the neighbouring times() repeat before 
verification runs, removing the context needed to explain the error.

Improve by adding an informative error message that catches all cases. 

  was:
 

Combining two loop termination modulators on a single repeat() produces an 
error that describes the symptom rather than the issue: 
{code:java}
gremlin> 
g.V().has('code','AGR').repeat(out()).until(has('code','CCU')).times(3).path().by('code')
The repeat()-traversal was not defined:[TinkerGraphStep(vertex,[code.eq(AGR)]), 
RepeatStep([VertexStep(OUT,vertex), 
RepeatEndStep],until([HasStep([code.eq(CCU)])]),emit(false)), 
RepeatStep(until(loops(3)),null,emit(false)), PathStep([value(code)])]
Type ':help' or ':h' for help.
Display stack trace? [yN] {code}
The message suggests the repeat() body is missing, when the actual problem is 
that times(n) is shorthand for until(loops). Both modulators populate the same 
slot on RepeatStep, so the second one creates a new, empty RepeatStep that is 
never given a body.

The same generic message appears for times().until(), times().times(), 
until().until() and the until-first form until(...).times(n).repeat(...). 
RepeatUnrollStrategy can also unroll the neighbouring times() repeat before 
verification runs, removing the context needed to explain the error.

Improve by adding an informative error message that catches all cases. 


> Improving error output for chained counters in repeat()
> -------------------------------------------------------
>
>                 Key: TINKERPOP-3289
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3289
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.7.7, 3.8.2
>            Reporter: Yang Xia
>            Priority: Major
>
>  
> Combining two loop termination modulators on a single repeat() produces an 
> error that describes the symptom rather than the issue: 
> {code:java}
> gremlin> 
> g.V().has('code','AGR').repeat(out()).until(has('code','CCU')).times(3).path().by('code')
> The repeat()-traversal was not 
> defined:[TinkerGraphStep(vertex,[code.eq(AGR)]), 
> RepeatStep([VertexStep(OUT,vertex), 
> RepeatEndStep],until([HasStep([code.eq(CCU)])]),emit(false)), 
> RepeatStep(until(loops(3)),null,emit(false)), PathStep([value(code)])]
> Type ':help' or ':h' for help.
> Display stack trace? [yN] {code}
> The message suggests the repeat() body is missing, when the actual problem is 
> that times() is shorthand for until(loops). Both modulators populate the same 
> slot on RepeatStep, so the second one creates a new, empty RepeatStep that is 
> never given a body.
> The same generic message appears for times().until(), times().times(), 
> until().until() and the until-first form until(...).times().repeat(...). 
> RepeatUnrollStrategy can also unroll the neighbouring times() repeat before 
> verification runs, removing the context needed to explain the error.
> Improve by adding an informative error message that catches all cases. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to