You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by "Rajat Khandelwal (JIRA)" <ji...@apache.org> on 2016/05/10 08:09:12 UTC

[jira] [Updated] (LENS-1039) Remove catch-all-to-wrap clauses from code

     [ https://issues.apache.org/jira/browse/LENS-1039?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajat Khandelwal updated LENS-1039:
-----------------------------------
    Issue Type: Sub-task  (was: Wish)
        Parent: LENS-657

> Remove catch-all-to-wrap clauses from code
> ------------------------------------------
>
>                 Key: LENS-1039
>                 URL: https://issues.apache.org/jira/browse/LENS-1039
>             Project: Apache Lens
>          Issue Type: Sub-task
>            Reporter: Rajat Khandelwal
>
> There are multiple places where we have this snippet:
> {noformat}
> try{
>   ...
> } catch(Exception/Throwable e) {
>   throw new LensException(e)
> }
> {noformat}
> Two problems with this:
> * If there's a run-time exception being thrown, it's unnecessarily wrapped
> * If the caught exception is also a LensException, it's also unnecessarily being wrapped
> Suggestion:
> {noformat}
> try{
>   ...
> } catch(CheckedException1 | CheckedException2 | ... e) {
>   throw new LensException(e);
> }
> {noformat}



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