DiamondLightSource / DiamondLightSource/blueapi

Improve error message when config files aren't valid

Open
#1,396 0 comments 0 reactions 0 assignees View on GitHub
c: cli
Dominant language
Python
Stars
13
Forks
13
Avg merge
2d 11h
Merged PRs (30d)
25

Description

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 '', but found ''
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.