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

SiriusResult can only wrap subclasses of RuntimeException #8

Open
smuir opened this issue Feb 7, 2014 · 2 comments
Open

SiriusResult can only wrap subclasses of RuntimeException #8

smuir opened this issue Feb 7, 2014 · 2 comments
Labels

Comments

@smuir
Copy link
Contributor

smuir commented Feb 7, 2014

This might be overly restrictive, especially since (for example) IOException is not a subclass of RuntimeException. Is there a reason SiriusResult can't just wrap Exception? I get that RuntimeException is the superclass of unchecked exceptions, but it's not obvious to me if or why that would be relevant.

@comcast-jonm
Copy link
Member

Well, since there are no throws declarations on the RequestHandler methods, it's not possible for checked exceptions to be thrown there. But there's no particular reason it couldn't be an Exception instead of a RuntimeException in a SiriusResult. I suspect if we clean up the RequestHandler interface as a result of dealing with #6 that a solution to this issue will fall out as well.

@smuir
Copy link
Contributor Author

smuir commented Feb 8, 2014

Good point. Yes, the Sirius library can't catch those exceptions, but I might reasonably want to catch them myself in my handlePut function and wrap them in the SiriusResult (or whatever it ends up being).

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

2 participants