Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 935AB172C1 for ; Fri, 10 Oct 2014 20:33:34 +0000 (UTC) Received: (qmail 49789 invoked by uid 500); 10 Oct 2014 20:33:34 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 49735 invoked by uid 500); 10 Oct 2014 20:33:34 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 49723 invoked by uid 99); 10 Oct 2014 20:33:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2014 20:33:34 +0000 Date: Fri, 10 Oct 2014 20:33:34 +0000 (UTC) From: "Haohui Mai (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-7207) libhdfs3 should not expose exceptions in public C++ API MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-7207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14167458#comment-14167458 ] Haohui Mai commented on HDFS-7207: ---------------------------------- bq. what's wrong with HDFS-7207.001.patch? Please note that the API needs to convey information more than the error number, for example, stack traces. The {{Status}} object should be able to contain a customized message. {code} class HdfsFileSystem : public enable_shared_from_this {code} Why {{HdfsFileSystem}} has to be a shared object? > libhdfs3 should not expose exceptions in public C++ API > ------------------------------------------------------- > > Key: HDFS-7207 > URL: https://issues.apache.org/jira/browse/HDFS-7207 > Project: Hadoop HDFS > Issue Type: Sub-task > Reporter: Haohui Mai > Assignee: Colin Patrick McCabe > Priority: Blocker > Attachments: HDFS-7207.001.patch > > > There are three major disadvantages of exposing exceptions in the public API: > * Exposing exceptions in public APIs forces the downstream users to be compiled with {{-fexceptions}}, which might be infeasible in many use cases. > * It forces other bindings to properly handle all C++ exceptions, which might be infeasible especially when the binding is generated by tools like SWIG. > * It forces the downstream users to properly handle all C++ exceptions, which can be cumbersome as in certain cases it will lead to undefined behavior (e.g., throwing an exception in a destructor is undefined.) -- This message was sent by Atlassian JIRA (v6.3.4#6332)