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

Methods do not declare that they throw IOException #8

Closed
rm5248 opened this issue Mar 11, 2018 · 1 comment

Comments

@rm5248
Copy link
Owner

commented Mar 11, 2018

I noticed the other day that an IOException can be thrown by certain methods, but on the Java side the methods are not declared as throwing an IOException.

We have a few options:

  • Declare all methods to throw IOException
  • Don't throw IOException?

Related to not throwing IOException, we can throw an IOException if we mess up something on the JNI side - if we can't find our handle we will throw an IOException, whereas we should really throw something like BadProgrammingException(subclass of RuntimeException).

@rm5248

This comment has been minimized.

Copy link
Owner Author

commented Mar 21, 2018

java.net.Socket can throw an IOException when creating, so simply changing all of the method signatures should work fine. It's a little ugly at that point unfortunately. :(

Since all of our getXXX() methods talk directly with the hardware, they should all potentially throw IOException.

@rm5248 rm5248 closed this Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.