Skip to content

Re-asking a question in a descendant context causes uninformative error #12

@rmoehn

Description

@rmoehn
What is your root question?
> What is your favourite colour?
Question: [$1: What is your favourite colour?]
Scratchpad: [$2: ]
Subquestions:

> ask What is your favourite colour?
Encountered an error with your command:
Traceback (most recent call last):
  File "/home/erle/repos/pstock-atchwork/patchwork/interface.py", line 40, in _do
    result = self.session.act(action)
  File "/home/erle/repos/pstock-atchwork/patchwork/scheduling.py", line 253, in act
    resulting_context = self.sched.resolve_action(self.current_context, action)
  File "/home/erle/repos/pstock-atchwork/patchwork/scheduling.py", line 166, in resolve_action
    raise ValueError("Action resulted in an infinite loop")
ValueError: Action resulted in an infinite loop
Question: [$1: What is your favourite colour?]
Scratchpad: [$2: ]
Subquestions:

>

The same happens with sub-questions of sub-questions.

It makes sense that re-asking an ancestor's question causes an error. However, the error message should be more informative. Especially in a real-world scenario, someone might unwittingly re-ask a question from further up the tree. Then they would be very confused as to why they caused an infinite loop with an innocent question.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions