Skip to content

Give a clean error for invalid initial cycle point syntax - #7401

Open
Sanjays2402 wants to merge 1 commit into
cylc:8.6.xfrom
Sanjays2402:fix/icp-bad-syntax-traceback
Open

Give a clean error for invalid initial cycle point syntax#7401
Sanjays2402 wants to merge 1 commit into
cylc:8.6.xfrom
Sanjays2402:fix/icp-bad-syntax-traceback

Conversation

@Sanjays2402

Copy link
Copy Markdown

Closes #7390

Some malformed initial cycle point values (e.g. T, T, T00, T18) make the isodatetime parser fail with a bare ValueError: too many values to unpack instead of an ISO8601SyntaxError. _parse_iso_cycle_point only catches IsodatetimeError, so that escaped as a traceback rather than a clean WorkflowConfigError. ingest_time now converts an unrecognised ValueError from the parser into an ISO8601SyntaxError, which the existing error handling already reports readably.

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests are included (or explain why tests are not needed).
  • Changelog entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

Some malformed cycle point values (e.g. "T, T") make the isodatetime
parser fail with a bare "ValueError: too many values to unpack" rather
than an ISO8601SyntaxError. _parse_iso_cycle_point only catches
IsodatetimeError, so the ValueError escaped as a traceback instead of a
WorkflowConfigError with a readable message.

ingest_time now converts an unrecognised ValueError from the parser into
an ISO8601SyntaxError, which the existing config error handling already
reports cleanly.

Adds a regression test covering the values reported in the issue.
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.

1 participant