Skip to content

Conversation

@DrPaulSharp
Copy link
Collaborator

@DrPaulSharp DrPaulSharp commented Sep 27, 2024

This PR refactors the ClassList._check_classes and ClassList._check_unique_name_fields routines to provide better error messages, specifically including the indices of the bad input in the input lists. This may help with mitigating the coercion issue identified in #79 alongside giving better information for bad input to routines that mutate ClassLists.

I'm open to input about the format of the error messages.

Copy link
Collaborator

@alexhroom alexhroom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good (as good as the Pydantic errors) but i think we could maybe push them to be better than the Pydantic errors, to make users' lives a lot simpler if they've got large lists. I also think that _validate_name_field could be updated to have a better error that e.g. says what indices the name is already defined at

@DrPaulSharp DrPaulSharp merged commit dfef174 into RascalSoftware:main Oct 2, 2024
@DrPaulSharp DrPaulSharp deleted the errors branch October 2, 2024 08:57
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

Successfully merging this pull request may close these issues.

2 participants