-
Notifications
You must be signed in to change notification settings - Fork 202
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
Handling non-IOExceptions in Take is broken #872
Comments
@paulodamaso/z please, pay attention to this issue |
@piotrkot/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot! |
@piotrkot This is a very sensitive question. Looks like we have three options here:
Drawbacks:
@yegor256 as this is a very controversial subject I'd like to know your last opinion about this |
@paulodamaso Thank you for listing out the options. If you asked me, I prefer option no. 2. In fact, Personally, I don't agree with the article by Sergey Kapralov. Please, keep |
@yegor256 please take a look at this |
@yegor256 ping |
@piotrkot @paulodamaso I think we should continue using |
First of all, Merry Christmas and Happy New Year to everyone! :) @yegor256 Please, explain why you think so. |
@yegor256 So, why did you allow change |
@piotrkot @fabriciofx OK, OK, you got me. I agree, let's do |
@yegor256 @piotrkot @fabriciofx @paulodamaso As an author of the post, mentioned in this discussion, let me bring up my point of view on this. I strongly disagree with this statement:
Actually, it completely doesn't matter whether your exceptions are checked or unchecked - you will still be blind to potential failures. Because the fact that some method is annotated with I'd vote for:
|
@skapral The issue here is about something else. However, as you were mentioned, I personally don't mind to discuss a bit more for clarity. (If you want to remove all checked exceptions from Takes, you would have to open a new issue).
|
@yegor256 @piotrkot @paulodamaso @skapral As you show us your point of view, let me show mine. I think there are two main points: what is an expected error and an unexpected error. What's is an expected error? It's something you know normal to fail, like validate a Social Security Number. Somebody can inform some wrong number, it's normal and happens all the time. Is expected to happens. But an unexpected error is something not normal to fail, like access a file into disk. The disk can fail, the file can has been moved, etc. It's not normal to fail. Comparing with Functional Programing (FP), there're two kinds of functions: pure and not pure. Pure functions, if you pass the same input will returns always the same output. For example, pass two numbers and get the sum of them. The not pure functions, on the other hand, not always returns the same output. They're unsafe. Why? Because the output depends on others things, like the OS, the disk, the network interfaces... So, they can (or not) fail. Thus, I see a method can throws an |
@yegor256 @piotrkot @paulodamaso @skapral A plus: a James Gosling interview where the first question (3:18) is about checked exceptions. |
@yegor256 Do we have a final decision on this according to EO beliefs and your PO needs? |
@paulodamaso I believe it's clearly stated here
|
@paulodamaso @yegor256 @skapral just for record: I've changed my mind about checked exceptions. So I think the best solution is remove the checked exceptions and use only runtime exceptions. |
@paulodamaso Can I help you? I can create a PR with code changed to "throws Exception". |
@yegor256 Do we have a final decision on this according to EO beliefs and your PO needs? We had some new arguments since your last veredict. |
@yegor256 ping |
I still believe that we should |
@piotrkot Please close |
Job |
This job is not in scope |
Take
interface expects to throwIOException
. This is limiting. In my Take implementations I often make SQL calls or JSON manipulations which throw checkedSQLException
or checkedJsonException
.Why
Take
cannot throwException
, instead? Especially, as in the blog I can read "use only Exception, without any sub-types.".The text was updated successfully, but these errors were encountered: