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

Add explicit exception and documentation for when types are valid #16

Merged
merged 1 commit into from
Feb 16, 2020

Conversation

tajobe
Copy link
Member

@tajobe tajobe commented Feb 16, 2020

References #15

As per #15, choosing an invalid type for given configuration used to result in an unclear ClassCastException:

java.lang.ClassCastException: org.simplemc.simplehealthbars2.healthbar.NameHealthbar cannot be cast to org.simplemc.simplehealthbars2.healthbar.PlayerHealthbar

Now, you'll end up with:

java.lang.IllegalStateException: Invalid player healthbar type! Must be one of: SCOREBOARD, ACTION

or

java.lang.IllegalStateException: Invalid mob healthbar type! Must be one of: NAME, ACTION

Ideally, these would come from code rather than being specified in the string literal, but that'll require some reorganization.

@tajobe tajobe added bug Something isn't working enhancement New feature or request labels Feb 16, 2020
@tajobe tajobe mentioned this pull request Feb 16, 2020
@tajobe tajobe merged commit 4901dbf into master Feb 16, 2020
@tajobe tajobe deleted the fixes/player-namebar-error branch February 16, 2020 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants