From issues-return-91345-archive-asf-public=cust-asf.ponee.io@cloudstack.apache.org Fri Mar 23 14:59:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9FDAE18064D for ; Fri, 23 Mar 2018 14:59:05 +0100 (CET) Received: (qmail 37338 invoked by uid 500); 23 Mar 2018 13:59:04 -0000 Mailing-List: contact issues-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list issues@cloudstack.apache.org Received: (qmail 37329 invoked by uid 500); 23 Mar 2018 13:59:04 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 37326 invoked by uid 99); 23 Mar 2018 13:59:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Mar 2018 13:59:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id EFB3F1A02FB for ; Fri, 23 Mar 2018 13:59:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id CAWT_pVcxMl3 for ; Fri, 23 Mar 2018 13:59:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C71B15F478 for ; Fri, 23 Mar 2018 13:59:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D5931E0250 for ; Fri, 23 Mar 2018 13:59:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3CD07214E0 for ; Fri, 23 Mar 2018 13:59:00 +0000 (UTC) Date: Fri, 23 Mar 2018 13:59:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CLOUDSTACK-10334) Inadequate information for handling catch clauses MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CLOUDSTACK-10334?page=3Dcom.atl= assian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D16411421#comment-16411421 ]=20 ASF GitHub Bot commented on CLOUDSTACK-10334: --------------------------------------------- lzh3636 opened a new pull request #2509: CLOUDSTACK-10334: Inadequate infor= mation for handling catch clauses URL: https://github.com/apache/cloudstack/pull/2509 =20 =20 ## Description The description of the problem: https://issues.apache.org/jira/browse/CLOUDSTACK-10334 I just added stack traces information to those two logging statements, s= o that the exception type can be generated to the logs. ## Types of changes - [ ] Breaking change (fix or feature that would cause existing function= ality to change) - [ ] New feature (non-breaking change which adds functionality) - [ ] Bug fix (non-breaking change which fixes an issue) - [x] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) =20 =20 ## Checklist: - [x] I have read the [CONTRIBUTING](https://github.com/apache/cloudstac= k/blob/master/CONTRIBUTING.md) document. - [x] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my changes. - [x] All new and existing tests passed. =20 =20 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org > Inadequate information for handling catch clauses > ------------------------------------------------- > > Key: CLOUDSTACK-10334 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-103= 34 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the defa= ult.)=20 > Reporter: Zhenhao Li > Priority: Major > Labels: easyfix > > Their are some situations that different exception types are caught, but = the handling of those exceptions can not show the differences of those type= s. Here are the code snippets we found which have this problem: > *cloudstack/server/src/main/java/com/cloud/api/dispatch/ParamProcessWorke= r.java* > [https://github.com/apache/cloudstack/blob/893a88d225276e45f12f9490e6af2c= 94a81c2965/server/src/main/java/com/cloud/api/dispatch/ParamProcessWorker.j= ava] > At Line=C2=A0*261*=C2=A0and Line=C2=A0*265.*=C2=A0We can see that two exc= eption types are caught, but the logging statements=C2=A0here=C2=A0can not = show the exception type at all. > Also they threw new exceptions after the logs, but the throw statements i= n these two catch clauses are identical, which=C2=A0are not=C2=A0distinguis= hable. > It may cause confusions to the person who=C2=A0is reading the log, the pe= rson can not know what exception happened here and can not distinguish logs= generated by these two statements. > =C2=A0Maybe adding stack trace information to these two=C2=A0logging stat= ements and change the log message to handle specific situations is a simple= way to improve it. -- This message was sent by Atlassian JIRA (v7.6.3#76005)