You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by krichter722 <gi...@git.apache.org> on 2018/03/18 22:46:22 UTC
[GitHub] curator pull request #260: replace raw Exception thrown by CompressionProvid...
GitHub user krichter722 opened a pull request:
https://github.com/apache/curator/pull/260
replace raw Exception thrown by CompressionProvider.compress and decompress with IOException
Throwing a raw `Exception` almost always indicates a design error (there's a lot of them in the project). It makes sense to replace `throws Exception` with the real exceptions thrown over time. This is the first stop.
PRs like #78 indicate that strange if not wrong understanding of exceptions and their treatment in `catch` blocks. Except for some example classes with `main` methods you never want to do something like `catch(Exception ex) {ex.printStackTrace()}`. If `Callable.call` is involved throwing `Exception` is a very bad approach as well and the fact that it throws `Exception` is no reason to throw it from the method calling `Callable.call`. In this case the exception needs to be wrapped into a custom type.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/krichter722/curator exceptions2
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/curator/pull/260.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #260
----
commit 3a761a22f258ca652def3f440e37992d2345ddf8
Author: Karl-Philipp Richter <kr...@...>
Date: 2018-03-18T22:40:06Z
replace raw Exception thrown by CompressionProvider.compress and decompress with IOException
----
---
[GitHub] curator issue #260: replace raw Exception thrown by CompressionProvider.comp...
Posted by Randgalt <gi...@git.apache.org>.
Github user Randgalt commented on the issue:
https://github.com/apache/curator/pull/260
Actually,m no it isn't a design error and is intentional. I'm -1 on this PR. I suggest it's better to discuss design issues on the Curator @dev mailing list. Also, I strongly suggest that you read the Apache Code of Conduct (see here: http://www.apache.org/foundation/policies/conduct.html).
---