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 <krichter722@...>
Date:   2018-03-18T22:40:06Z

    replace raw Exception thrown by CompressionProvider.compress and decompress 
with IOException

----


---

Reply via email to