Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify error messages from config input errors #5

Open
pingings opened this issue Aug 6, 2024 · 0 comments
Open

clarify error messages from config input errors #5

pingings opened this issue Aug 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@pingings
Copy link

pingings commented Aug 6, 2024

The default config file contains invalid default values for experiment.id and participant.id which throws an error, however the problem could be made more clear

Example of error message:

Traceback (most recent call last):
  File "C:\Users\Admin\.conda\envs\matbii\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Admin\.conda\envs\matbii\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Admin\.conda\envs\matbii\lib\site-packages\matbii\__main__.py", line 78, in <module>
    config = Configuration.from_file(args.config, context=context)
  File "C:\Users\Admin\.conda\envs\matbii\lib\site-packages\matbii\config\__init__.py", line 263, in from_file
    return Configuration.model_validate_json(f.read(), context=context)
  File "C:\Users\Admin\.conda\envs\matbii\lib\site-packages\pydantic\main.py", line 597, in model_validate_json
    return cls.__pydantic_validator__.validate_json(json_data, strict=strict, context=context)
pydantic_core._pydantic_core.ValidationError: 2 validation errors for Configuration
experiment.id
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.8/v/string_type
participant.id
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.8/v/string_type
@BenedictWilkins BenedictWilkins added the enhancement New feature or request label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants