Conan: [feature] Confusing error message when typo in profile

Created on 29 Apr 2020  路  2Comments  路  Source: conan-io/conan

I had a typo in my profile file:

includes(cmake_3_16)

[build_requires]
doxygen/1.8.15@company/stable

Where it should have been include instead of includes.
When running Conan, I got the following error message:

ERROR: Error reading 'documentation' profile: Error parsing the profile text file: not enough values to unpack (expected 2, got 1)

At least I knew that something is wrong with the profile, but the error message was a bit misleading
A more helpful message could have been:

ERROR: Error reading 'documentation' profile: Error parsing the profile text file: includes is not a valid keyword

or something similar.

Environment Details (include every applicable attribute)

  • Conan version: 1.24.1
low ux medium bug

Most helpful comment

Thanks for reporting it. I think it should be easy to identify this error and provide a better message. Thanks!

All 2 comments

Thanks for reporting it. I think it should be easy to identify this error and provide a better message. Thanks!

I would like to work on this issue.

The problem is happening in the __init__ method from the ProfileParser class:

name, value = line.split("=", 1)

I'll handle this situation and raise a new exception called, for instance, ConanParsingError. I think this new exception can be helpful to handle parsing errors easily in other places.

Was this page helpful?
0 / 5 - 0 ratings