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

[Bug]: createToken() should have better exception error messages #4926

Open
Azhrei opened this issue Sep 16, 2024 · 0 comments
Open

[Bug]: createToken() should have better exception error messages #4926

Azhrei opened this issue Sep 16, 2024 · 0 comments
Labels

Comments

@Azhrei
Copy link
Member

Azhrei commented Sep 16, 2024

Describe the Bug

createToken() has many, many options, but when something goes wrong, a single generic exception message is generated. The message should be directly related to the field that caused the exception.

(It would be nice if all parameters could be validated and references to all failing fields were provided, but that is likely to make the exception message excessively long.)

To Reproduce

See this Discord thread by @tdufor sample code and some discussion.

Expected Behaviour

When there's an error accessing a particular resource, say so, whether it's the name parameter, tokenImage parameter, or something else. Also report parameters that have invalid values by including both the parameter name and the list of valid values (or range of valid values, as appropriate).

Screenshots

No response

MapTool Info

Version: 1.14.3 (as well as older and newer versions)

Desktop

OS: All supported

Additional Context

No response

@Azhrei Azhrei added the bug label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant