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

Proposal: make UnirestException a RuntimeException #23

Open
joshgontijo opened this issue Oct 12, 2017 · 0 comments
Open

Proposal: make UnirestException a RuntimeException #23

joshgontijo opened this issue Oct 12, 2017 · 0 comments

Comments

@joshgontijo
Copy link
Owner

From #181

Hello,
A few months ago I started using UniRest and I have mostly enjoyed it. The one criticism is that UnirestException is checked. I would like to propose that it be changed to a RuntimeException for the following reasons:

Checked exceptions do not work well (or at all) with Java 8 streams and poorly with lambdas in general without writing your own checkable function library. This makes using Unirest in a stream or lambda painful
UnirestException is generic in of itself and provides no clue about what you want the developer to do in case it happens without unpacking the exception to look at the "real reason". As such it's no better than a RuntimeException and is far more annoying.
Checked Exceptions have mostly been abandoned as a failure by pretty much every post-java language in existence. https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=checked%20exceptions%20are%20evil

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

No branches or pull requests

1 participant