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

Calling MappingReader.read with an unsupported format results in an undescriptive exception #25

Closed
Juuxel opened this issue Sep 19, 2022 · 2 comments · May be fixed by #56
Closed

Calling MappingReader.read with an unsupported format results in an undescriptive exception #25

Juuxel opened this issue Sep 19, 2022 · 2 comments · May be fixed by #56

Comments

@Juuxel
Copy link
Member

Juuxel commented Sep 19, 2022

When one of the read methods is passed an unsupported format (apart from MCP), the code throws an IllegalStateException with no message:

default:
throw new IllegalStateException();

IllegalStateException isn't really appropriate here ("Signals that a method has been invoked at an illegal or inappropriate time."), and the user gets no useful information from the exception since it has no message either.

@sfPlayer1
Copy link
Contributor

bc87873 adds an explicit check

The quoted code wasn't supposed to verify that the format is compatible with Reader, but to detect cases that shouldn't happen (switch didn't match somehow..)

@NebelNidas
Copy link
Collaborator

Since every format MIO supports now has a reader available (and I guess we're going to enforce this from now on), I'm going to close this.

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 a pull request may close this issue.

3 participants