curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Vines <vi...@apache.org>
Subject Re: Raising of raw Exceptions (HP Fortify SCA issues)
Date Mon, 10 Mar 2014 21:29:39 GMT
I've brought this up before (https://issues.apache.org/jira/browse/
CURATOR-29 <https://sqrrldata.atlassian.net/browse/CURATOR-29> ), but was
closed as a 'style' difference.


On Mon, Mar 10, 2014 at 5:15 PM, Lavoie, John L <john.lavoie@optum.com>wrote:

>  We have recently started including references to Curator in our code.
> We run all of our own code through Fortify SCA for static analysis.
> Fortify is not happy that our calls to Curator raise exceptions of the type
> Exception and is complaining about "Overly broad Catch".   Is there a
> reason Curator needs to throw such broad exceptions as opposed to the
> underlying exception that was really raised?
>
>
>
> As an example, here is a utility method I've created, which Fortify
> doesn't like.
>
>     *public* PathChildrenCache getCacheForPath(String requestedPath) {
>
>         PathChildrenCache cache = *new* PathChildrenCache(client,
> requestedPath, *true*);
>
>         *try* {
>
>             cache.start(StartMode.BUILD_INITIAL_CACHE);
>
>         } *catch* (Exception e) {
>
>             LOG.error(e);
>
>               // reraise goes here
>
>         }
>
>         *return* cache;
>
>     }
>
>
>
> John
>
>
> This e-mail, including attachments, may include confidential and/or
> proprietary information, and may be used only by the person or entity
> to which it is addressed. If the reader of this e-mail is not the intended
> recipient or his or her authorized agent, the reader is hereby notified
> that any dissemination, distribution or copying of this e-mail is
> prohibited. If you have received this e-mail in error, please notify the
> sender by replying to this message and delete this e-mail immediately.
>

Mime
View raw message