You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2016/06/30 11:44:10 UTC

[jira] [Resolved] (CRYPTO-95) Code should never catch Throwable

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

Sebb resolved CRYPTO-95.
------------------------
       Resolution: Fixed
    Fix Version/s: 1.0.0

CRYPTO-95 - Code should never catch Throwable

Replaced with Exception

Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/8139303d
Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/8139303d
Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/8139303d


> Code should never catch Throwable
> ---------------------------------
>
>                 Key: CRYPTO-95
>                 URL: https://issues.apache.org/jira/browse/CRYPTO-95
>             Project: Commons Crypto
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 1.0.0
>
>
> As a general rule, code should never catch Throwable or Error, only Exception.
> Sometimes it is necessary to catch more than just Exception, but if so, the code must be careful to rethrow certain errors, e.g.
> ThreadDeath
> VirtualMachineError
> There may be some others
> If the throwable is not logged, then it's vital to ensure that only the appropriate ones are swallowed.
> But it is better to be explicit and only catch errors which are safe to handle.



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