From owner-freebsd-arch@FreeBSD.ORG Fri Aug 1 05:04:41 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCF6E662; Fri, 1 Aug 2014 05:04:40 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1blp0183.outbound.protection.outlook.com [207.46.163.183]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DDBF208A; Fri, 1 Aug 2014 05:04:40 +0000 (UTC) Received: from BLUPR05MB724.namprd05.prod.outlook.com (10.141.207.154) by BLUPR05MB054.namprd05.prod.outlook.com (10.255.210.149) with Microsoft SMTP Server (TLS) id 15.0.995.14; Fri, 1 Aug 2014 05:04:38 +0000 Received: from BLUPR05CA010.namprd05.prod.outlook.com (10.255.219.168) by BLUPR05MB724.namprd05.prod.outlook.com (10.141.207.154) with Microsoft SMTP Server (TLS) id 15.0.995.14; Fri, 1 Aug 2014 05:04:37 +0000 Received: from BN1AFFO11FD035.protection.gbl (2a01:111:f400:7c10::197) by BLUPR05CA010.outlook.office365.com (2a01:111:e400:83f::40) with Microsoft SMTP Server (TLS) id 15.0.995.14 via Frontend Transport; Fri, 1 Aug 2014 05:04:37 +0000 Received: from P-EMF02-SAC.jnpr.net (66.129.239.16) by BN1AFFO11FD035.mail.protection.outlook.com (10.58.52.159) with Microsoft SMTP Server (TLS) id 15.0.990.10 via Frontend Transport; Fri, 1 Aug 2014 05:04:37 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF02-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Thu, 31 Jul 2014 22:04:36 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id s7154Yn91048; Thu, 31 Jul 2014 22:04:34 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 82C9E580A2; Thu, 31 Jul 2014 22:04:34 -0700 (PDT) To: Poul-Henning Kamp Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML In-Reply-To: <58665.1406842603@critter.freebsd.dk> References: <201407312130.s6VLUFSP097778@idle.juniper.net> <58665.1406842603@critter.freebsd.dk> Comments: In-reply-to: Poul-Henning Kamp message dated "Thu, 31 Jul 2014 21:36:43 -0000." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Thu, 31 Jul 2014 22:04:34 -0700 Message-ID: <20140801050434.82C9E580A2@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.16; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(51704005)(189002)(199002)(76482001)(21056001)(83072002)(97736001)(107046002)(95666004)(76506005)(81156004)(110136001)(106466001)(44976005)(48376002)(62966002)(89996001)(57986006)(70486001)(84676001)(76176999)(81542001)(50986999)(46102001)(99396002)(68736004)(74502001)(31966008)(93546004)(64706001)(92726001)(33656002)(77156001)(79102001)(69596002)(92566001)(87286001)(6806004)(20776003)(86362001)(4396001)(83322001)(74662001)(102836001)(105596002)(87936001)(102176002)(93916002)(85852003)(81342001)(104166001)(88136002)(50226001)(47776003)(80022001)(77982001)(85306004)(42262001); DIR:OUT; SFP:; SCL:1; SRVR:BLUPR05MB724; H:P-EMF02-SAC.jnpr.net; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; LANG:en; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 029097202E Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.16 as permitted sender) Authentication-Results: spf=softfail (sender IP is 66.129.239.16) smtp.mailfrom=sjg@juniper.net; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-OriginatorOrg: juniper.net Cc: arch@freebsd.org, John-Mark Gurney , marcel@freebsd.org, Phil Shafer X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2014 05:04:41 -0000 On Thu, 31 Jul 2014 21:36:43 +0000, Poul-Henning Kamp writes: >>sbuf looks like a simple case, returning either ENOMEM or the >>error code from the flush function. libxo can keep a "there's >>been an error" flag that the user can retrieve, but all the >>details of what's gone wrong would be lost. Or it can buffer >>the contents of warning messages and deliver it to the caller. >The point here is one of API design, and experience has shown >that either error-handling is convenient or it doesn't happen. > >I don't see the libxo case being any different from sbuf >in this respect, in fact I see it being almost even more >important because the readers are non-humans. The libxo case can be complicated by the structured output. If you have emitted and then you encounter an exception, even if you output a nice sorry about that your peer may not cope unless you also close all the open elements: etc. Of course I wouldn't be surprised if the lib already handles all that ;-)