Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 59946200B29 for ; Thu, 30 Jun 2016 13:29:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5864B160A63; Thu, 30 Jun 2016 11:29:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 93DC7160A51 for ; Thu, 30 Jun 2016 13:29:11 +0200 (CEST) Received: (qmail 69145 invoked by uid 500); 30 Jun 2016 11:29:10 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 69111 invoked by uid 99); 30 Jun 2016 11:29:10 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jun 2016 11:29:10 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7AAF92C027F for ; Thu, 30 Jun 2016 11:29:10 +0000 (UTC) Date: Thu, 30 Jun 2016 11:29:10 +0000 (UTC) From: "Sebb (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CRYPTO-95) Code should never catch Throwable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 30 Jun 2016 11:29:12 -0000 Sebb created CRYPTO-95: -------------------------- Summary: 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 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)