Add error message specifying that we can't parse pyproject.toml#734
Add error message specifying that we can't parse pyproject.toml#734radoering merged 7 commits intopython-poetry:mainfrom
Conversation
|
I think the I'd even go as far as to suggest the most likely cause, and how to fix it, maybe similar to: Couldn't find a good way to check for that duplication from the exception alone. if e.msg = 'Cannot overwrite a value':
txt += "\nThis is often caused by a duplicate entry."This give everyone a clear cause to look out for. |
That's ok with me. |
Done. Getting the message out of a
The unit test would also fail, so it would be caught and updated eventually. |
Add the TOML error message at 0 verbosity. Add clarifying detail if the error is due to a duplicate entry.
Co-authored-by: Randy Döring <[email protected]>
|
Thanks for this @mscheifer! |
Resolves: python-poetry/poetry#9394
Problem
Poetry gives confusing error messages when there is a parse error in the pyproject.toml file.
For example:
The error is confusing because it's unclear that this error relates to parsing the pyproject.toml file. For
poetry runspecifically it's also unclear if the error is coming from poetry or the command you are running.Change
With this change instead we will see.
Open questions
Should we try to include the toml parse error at 0 verbosity somehow? Or alternatively, we could explicitly say "re-run with -v" in the message.Yes let's include the exception message.Please let me know if anything should be changed to fit the project code standards.