Skip to content

Improve error messages when flag values are mistaken for mission names#374

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/improve-error-messages
Draft

Improve error messages when flag values are mistaken for mission names#374
Copilot wants to merge 3 commits intomainfrom
copilot/improve-error-messages

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

Passing an argument to a boolean flag (e.g. --catchup-skip-known-results-for-testing=false) causes the parser to treat the value as a positional arg, producing the unhelpful error Unknown mission: false.

Added contextual hints to the unknown mission error when the value looks like it was misrouted from a flag:

  • Flag value detection: If the unrecognized mission is true/false or numeric, suggest the user may have passed a value to a flag that doesn't accept one
  • Option detection: If it starts with -, suggest a possible typo or unsupported option
# Before
[ERR] Unknown mission: false

# After
[ERR] Unknown mission: false
[ERR] Note: 'false' looks like a value for a command-line flag rather than a mission name. You may have passed an argument to a flag that doesn't accept one (e.g. --catchup-skip-known-results-for-testing=false instead of --catchup-skip-known-results-for-testing).

The existing "Available missions" list still prints in all cases.

Copilot AI and others added 2 commits April 16, 2026 22:57
When an unknown mission name looks like a common flag value (e.g.,
'true', 'false', a number), or a command-line option (starts with '-'),
provide a more helpful error message suggesting the user may have passed
an argument to a flag that doesn't accept one.

Agent-Logs-Url: https://github.com/stellar/supercluster/sessions/599c78dd-f2a6-4294-bdb3-3c150c3c027a

Co-authored-by: marta-lokhova <9428003+marta-lokhova@users.noreply.github.com>
…e in error message

Agent-Logs-Url: https://github.com/stellar/supercluster/sessions/599c78dd-f2a6-4294-bdb3-3c150c3c027a

Co-authored-by: marta-lokhova <9428003+marta-lokhova@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve error messages around improperly passed arguments Improve error messages when flag values are mistaken for mission names Apr 16, 2026
Copilot AI requested a review from marta-lokhova April 16, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error messages around improperly passed arguments

2 participants