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

Better formatting for error messages #184

Open
phackstock opened this issue Oct 4, 2022 · 0 comments
Open

Better formatting for error messages #184

phackstock opened this issue Oct 4, 2022 · 0 comments
Assignees

Comments

@phackstock
Copy link
Contributor

Some error messages are currently somewhat hard to read, example:

pydantic.error_wrappers.ValidationError: 1 validation error for RegionProcessor
mappings -> ['REMIND 3.0']
  Region(s) ['REMIND 3.0|Canada, NZ, Australia', 'REMIND 3.0|China', 'REMIND 3.0|EU 28', 'REMIND 3.0|India', 'REMIND 3.0|Japan', 'REMIND 3.0|Latin America and the Caribbean', 'REMIND 3.0|Middle East, North Africa, Central Asia', 'REMIND 3.0|Non-EU28 Europe', 'REMIND 3.0|other Asia', 'REMIND 3.0|Countries from the Reforming Economies of the Former Soviet Union', 'REMIND 3.0|Sub-saharan Africa', 'REMIND 3.0|United States of America'] in mappings/REMIND+3.0.yml not defined in the DataStructureDefinition (type=value_error.region_not_defined; region=['REMIND 3.0|Canada, NZ, Australia', 'REMIND 3.0|China', 'REMIND 3.0|EU 28', 'REMIND 3.0|India', 'REMIND 3.0|Japan', 'REMIND 3.0|Latin America and the Caribbean', 'REMIND 3.0|Middle East, North Africa, Central Asia', 'REMIND 3.0|Non-EU28 Europe', 'REMIND 3.0|other Asia', 'REMIND 3.0|Countries from the Reforming Economies of the Former Soviet Union', 'REMIND 3.0|Sub-saharan Africa', 'REMIND 3.0|United States of America']; file=mappings/REMIND+3.0.yml)

simply introducing a few strategically placed line breaks should make things better:

pydantic.error_wrappers.ValidationError: 1 validation error for RegionProcessor
mappings -> ['REMIND 3.0']
Region(s):
 ['REMIND 3.0|Canada, NZ, Australia', 'REMIND 3.0|China', 'REMIND 3.0|EU 28', 'REMIND 3.0|India', 'REMIND 3.0|Japan', 'REMIND 3.0|Latin America and the Caribbean', 'REMIND 3.0|Middle East, North Africa, Central Asia', 'REMIND 3.0|Non-EU28 Europe', 'REMIND 3.0|other Asia', 'REMIND 3.0|Countries from the Reforming Economies of the Former Soviet Union', 'REMIND 3.0|Sub-saharan Africa', 'REMIND 3.0|United States of America'] 
    in mappings/REMIND+3.0.yml 
not defined in the DataStructureDefinition 
(type=value_error.region_not_defined; region=['REMIND 3.0|Canada, NZ, Australia', 'REMIND 3.0|China', 'REMIND 3.0|EU 28', 'REMIND 3.0|India', 'REMIND 3.0|Japan', 'REMIND 3.0|Latin America and the Caribbean', 'REMIND 3.0|Middle East, North Africa, Central Asia', 'REMIND 3.0|Non-EU28 Europe', 'REMIND 3.0|other Asia', 'REMIND 3.0|Countries from the Reforming Economies of the Former Soviet Union', 'REMIND 3.0|Sub-saharan Africa', 'REMIND 3.0|United States of America']; file=mappings/REMIND+3.0.yml)

or something along those lines.

@phackstock phackstock self-assigned this Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant