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

Improve messages for multiple errors #2873

Closed
binste opened this issue Feb 5, 2023 · 3 comments · Fixed by #3009
Closed

Improve messages for multiple errors #2873

binste opened this issue Feb 5, 2023 · 3 comments · Fixed by #3009
Assignees

Comments

@binste
Copy link
Contributor

binste commented Feb 5, 2023

Based on feedback from @joelostblom in #2842 (comment):

On brief comment now, do you think it is confusing to see three error messages like in your example above? I don't know what would be a feasible solution technically here, but I am thinking that instead of

'asdf' is not one of ['zero', 'center', 'normalize']
'asdf' is not of type 'null'
'asdf' is not of type 'boolean'

the message would be clearer as:

'asdf' needs to be one of ['zero', 'center', 'normalize'] or of type 'null' or boolean'

Also see subsequent comments in that thread. #2842 (comment) is also relevant.

@binste binste changed the title Combine multiple error messages Improve message for multiple errors Feb 5, 2023
@binste binste changed the title Improve message for multiple errors Improve messages for multiple errors Feb 5, 2023
@binste
Copy link
Contributor Author

binste commented Mar 12, 2023

alt.Chart().encode(alt.Angle().sort("invalid_value")) gives:

'invalid_value' is not of type 'array'
'invalid_value' is not of type 'array'
'invalid_value' is not of type 'array'
'invalid_value' is not of type 'array'

Error messages should be deduplicated based on .message attribute. Furthermore, this should ideally show all literal values which are acceptable such as ["x", "y", ...].

Maybe one for the long list but we could investigate if it make sense to show the error messages of all leaves in this error tree that we're traversing to get the relevant error messages. Or should it be dependent on what kind of object the user provided as a value, e.g. if a string such as "invalid_value" is provided then it should show acceptable string values but if an unsupported type is passed then it should show which types are accepted?

@joelostblom
Copy link
Contributor

I also saw some duplicated rounds of messages in #2896

@binste
Copy link
Contributor Author

binste commented Apr 2, 2023

FYI, I'm working on this as part of #2915 and #2913. Feel free to assign to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants