Skip to content

Improve error message when config files aren't valid #1396

@tpoliaw

Description

@tpoliaw

If a config file passed to the CLI is not valid, the user gets a stacktrace instead of an error message

$ uv run blueapi -c pyproject.toml controller plans
Traceback (most recent call last):
<...>
  File "/dls/athena/blueapi/.venv/lib/python3.11/site-packages/yaml/parser.py", line 171, in parse_document_start
    raise ParserError(None, None,
yaml.parser.ParserError: expected '<document start>', but found '<scalar>'
  in "pyproject.toml", line 2, column 1

Most of this is noise with only the filename, line and column being vaguely relevant.

Acceptance Criteria

  • User error is useful when config file isn't

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