stanbol-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reto Bachmann-Gmür <r...@apache.org>
Subject Don't catch Security Exceptions (Re: svn commit: r1465093 - in /stanbol/trunk/rules/adapters: clerezza/src/main/java/org/apache/stanbol/rules/adapters/clerezza/ jena/src/main/java/org/apache/stanbol/rules/adapters/jena/ sparql/src/main/java/org/apache/stanbol/rules/adapters/sparql/ swrl/s...)
Date Fri, 05 Apr 2013 19:06:30 GMT
Hi Andrea

             } catch (SecurityException e) {
> -                // TODO Auto-generated catch block
> -                e.printStackTrace();
> +                log.error(e.getMessage(), e);
>              }
>

I think catching catching runtime exception if you are not sure that you
have a better way to handle them than your caller is a bad practice anyway.
But for SecurityException it is particularly bad because the parent usually
can do something about it, i.e. allow the user to log in an repeat the
request in a different security context (see STANBOL-728).

So this catch cause should be removed.

Cheers,
Reto

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message