curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CURATOR-219) Avoid use of Throwable
Date Sat, 20 Jun 2015 14:32:00 GMT

    [ https://issues.apache.org/jira/browse/CURATOR-219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14594626#comment-14594626
] 

ASF GitHub Bot commented on CURATOR-219:
----------------------------------------

Github user Randgalt commented on a diff in the pull request:

    https://github.com/apache/curator/pull/78#discussion_r32884938
  
    --- Diff: curator-client/src/main/java/org/apache/curator/ensemble/exhibitor/ExhibitorEnsembleProvider.java
---
    @@ -301,7 +301,7 @@ else if ( port != thePort )
                         values.putAll(decodeExhibitorList(encoded));
                         done = true;
                     }
    -                catch ( Throwable e )
    +                catch ( Exception e )
    --- End diff --
    
    I don't understand how this is an improvement. Exceptions such as NPE or OOM would be
lost with this change. By catching Throwable, those exceptions are logged.


> Avoid use of Throwable
> ----------------------
>
>                 Key: CURATOR-219
>                 URL: https://issues.apache.org/jira/browse/CURATOR-219
>             Project: Apache Curator
>          Issue Type: Bug
>            Reporter: Mike Drob
>            Assignee: Jordan Zimmerman
>             Fix For: 3.0.0
>
>
> We liberally catch {{Throwable}} in our code, which can mask more troubling issues like
{{OutOfMemory}} or other errors. In most cases we should be catching Exception instead.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message