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 CF08D200D5A for ; Thu, 30 Nov 2017 04:12:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CBD66160C16; Thu, 30 Nov 2017 03:12:04 +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 1DC1C160C04 for ; Thu, 30 Nov 2017 04:12:03 +0100 (CET) Received: (qmail 92336 invoked by uid 500); 30 Nov 2017 03:12:03 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 92318 invoked by uid 99); 30 Nov 2017 03:12:03 -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; Thu, 30 Nov 2017 03:12:03 +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 AE00D1A024D for ; Thu, 30 Nov 2017 03:12:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id i6ib1ao0zq2d for ; Thu, 30 Nov 2017 03:12:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 885545F477 for ; Thu, 30 Nov 2017 03:12: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 E1B88E0942 for ; Thu, 30 Nov 2017 03:12: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 3C83621058 for ; Thu, 30 Nov 2017 03:12:00 +0000 (UTC) Date: Thu, 30 Nov 2017 03:12:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@thrift.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (THRIFT-3610) Streamline exception handling in Python server handler MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 30 Nov 2017 03:12:05 -0000 [ https://issues.apache.org/jira/browse/THRIFT-3610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16272094#comment-16272094 ] ASF GitHub Bot commented on THRIFT-3610: ---------------------------------------- GitHub user jeking3 opened a pull request: https://github.com/apache/thrift/pull/1426 THRIFT-3610 Streamline exception handling in Python server handler Client: py (resubmitting for nsuke) This closes #842 This closes #1426 You can merge this pull request into a Git repository by running: $ git pull https://github.com/jeking3/thrift THRIFT-3610-take-2 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/thrift/pull/1426.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1426 ---- commit 93950c84abf8d91db5f2e5c6800fbe78a23f7cb7 Author: Nobuaki Sukegawa Date: 2016-02-10T22:06:21Z THRIFT-3610 Streamline exception handling in Python server handler Client: py This closes #842 This closes #1426 ---- > Streamline exception handling in Python server handler > ------------------------------------------------------ > > Key: THRIFT-3610 > URL: https://issues.apache.org/jira/browse/THRIFT-3610 > Project: Thrift > Issue Type: Sub-task > Components: Python - Compiler > Reporter: Aki Sukegawa > Assignee: Aki Sukegawa > Priority: Minor > > It also serves as a reference implementation of THRIFT-3607. > Only needed behavior change was to send catched TApplicationException, rather than opaque TApplicationException(INTERNAL_ERROR). > It now looks like this (comments are not generated) > {code} > try: > # handler call > ... > except TTransport.TTransportException: # disconnect > raise > except Xception as err1: # declared exception > msg_type = TMessageType.REPLY > result.err1 = err1 > except TApplicationException as ex: # send as is > logging.exception('TApplication exception in handler') > msg_type = TMessageType.EXCEPTION > result = ex > except Exception: # send INTERNAL_ERROR > logging.exception('Unexpected exception in handler') > msg_type = TMessageType.EXCEPTION > result = TApplicationException(...) > result.write(...) > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)