Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E9B9C11B60 for ; Fri, 1 Aug 2014 20:07:02 +0000 (UTC) Received: (qmail 28599 invoked by uid 500); 1 Aug 2014 20:07:02 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 28554 invoked by uid 500); 1 Aug 2014 20:07:02 -0000 Mailing-List: contact dev-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list dev@curator.apache.org Received: (qmail 28536 invoked by uid 99); 1 Aug 2014 20:07:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2014 20:07:02 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mdrob@cloudera.com designates 209.85.218.44 as permitted sender) Received: from [209.85.218.44] (HELO mail-oi0-f44.google.com) (209.85.218.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2014 20:07:00 +0000 Received: by mail-oi0-f44.google.com with SMTP id x69so3076361oia.31 for ; Fri, 01 Aug 2014 13:06:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=gLuxT+jKd4TnOC+oxgv9l9N/ToVuZXRZm4o0zudCTEw=; b=F9SceYeLmIlcCwo5guvgPUNUTBd4kRAjtkDVOmyigUBVAdp3dSR2cbRsZQY0BOGwlK hVY4wqyjg5jyUducKe9ChabypdovGF0lJDVhQsqXdsyU+tfkoOrNTlOfzcPEaZzxuQ/v cx06X0po0BEJi0jGqXfkbJBJTdiJ+3dV2on/OGCvQfgIDBbgS+jxpPW04seIP1GRTEfU 2P5FaG6xWC6aRNYus7d+Avlgx6IV0NoH7MnQugnqF1XyPUcwPw5Sm5bSFkDjyhOpnj7T CHtOSZt+NVwIXzI3wCWgTVY6n8dIy1ceE01kZ/9QId+aVPZv81Yyf+/TTm5UZlDzF0u3 N88g== X-Gm-Message-State: ALoCoQkJ43om8guHulf4DtULtX5mcr+Xl9VSRVA1t+y86c7l5Mg2SDbQuLJvOmmtO3oSsF1gUO92 X-Received: by 10.182.149.235 with SMTP id ud11mr11807952obb.50.1406923595117; Fri, 01 Aug 2014 13:06:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.145.43 with HTTP; Fri, 1 Aug 2014 13:06:15 -0700 (PDT) In-Reply-To: References: From: Mike Drob Date: Fri, 1 Aug 2014 15:06:15 -0500 Message-ID: Subject: Re: Exception throwing To: Jordan Zimmerman Cc: dev@curator.apache.org Content-Type: multipart/alternative; boundary=001a11348abc1d58d504ff96eddf X-Virus-Checked: Checked by ClamAV on apache.org --001a11348abc1d58d504ff96eddf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable So what's preventing us from changing this going forward? It's software, we have the ability to fix it; if something can be improved and we are able to improve it, then we can go ahead and do that. On Fri, Aug 1, 2014 at 2:55 PM, Jordan Zimmerman wrote: > Like I said, if I could go back, I=E2=80=99d get rid of checked exception= s > entirely. > > -JZ > > From: Mike Drob > Reply: Mike Drob > > Date: August 1, 2014 at 2:54:47 PM > To: Jordan Zimmerman > > > Cc: dev@curator.apache.org > > > Subject: Re: Exception throwing > > So why declare that we throw exceptions instead of just throwing > everything as a RuntimeException (or subclass thereof)? > > > On Fri, Aug 1, 2014 at 2:49 PM, Jordan Zimmerman < > jordan@jordanzimmerman.com> wrote: > >> -1 (binding) >> >> If I could go back I=E2=80=99d remove all checked exceptions entirely. = I don=E2=80=99t >> think there=E2=80=99s an objective answer here - it comes down to person= al >> preference, etc. I don=E2=80=99t see much value in touching nearly every= file in >> the library in order to do this. We=E2=80=99ve had maybe 2 or 3 requests= in the >> many years that Curator has exists. This suggests that the overwhelming >> majority accept the current exception semantics. If you can point to an >> actual bug that this causes that would be helpful. >> >> -Jordan >> >> From: Mike Drob >> Reply: dev@curator.apache.org > >> >> Date: August 1, 2014 at 2:32:07 PM >> To: dev@curator.apache.org > >> >> Subject: Exception throwing >> >> I'd like to revisit the discussion around always throwing Exception in >> the >> API. There were two JIRA issues - CURATOR-135 and CURATOR-29 - that touc= h >> on this subject, but I think there is a good conversation to be had. >> >> I understand the suggestions that if an exception is thrown, we are in a >> bad state, regardless of the type of exception. However, throwing >> Exception >> comes with some unfortunate Java baggage... >> >> By declaring thrown Exception, we force consumers to also catch >> RuntimeExceptions instead of letting them propagate as they normally >> would. >> In some cases, the calling code may need to attempt roll-back semantics, >> or >> retry outside of what Curator provides, or something else that we haven'= t >> thought of. >> >> I'd like to propose replacing much of the thrown Exception methods with >> CuratorException. This will still carry the connotation that it doesn't >> matter what kind of exception we encounter, they're all bad. It will als= o >> be backwards compatible with the previous API, since users will still be >> able to catch Exception in their calling code. And it has the advantage = of >> separating checked exceptions from unchecked ones, so that users don't >> unintentionally catch something unrelated. >> >> Thoughts? >> >> I tried looking for more details behind the design decision to always >> throw >> Exception, but wasn't able to find them. If they're already documented, >> I'd >> love to be pointed at the wiki or site, or a mailing list thread will do >> in >> a pinch. >> >> Thanks, >> Mike >> >> > --001a11348abc1d58d504ff96eddf--