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 038CB113CA for ; Mon, 1 Sep 2014 16:21:21 +0000 (UTC) Received: (qmail 44305 invoked by uid 500); 1 Sep 2014 16:21:20 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 44258 invoked by uid 500); 1 Sep 2014 16:21:20 -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 44246 invoked by uid 99); 1 Sep 2014 16:21:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Sep 2014 16:21:20 +0000 Date: Mon, 1 Sep 2014 16:21:20 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CURATOR-144) TreeCache should use a builder for advanced options 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/CURATOR-144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14117533#comment-14117533 ] ASF GitHub Bot commented on CURATOR-144: ---------------------------------------- Github user dragonsinth commented on a diff in the pull request: https://github.com/apache/curator/pull/41#discussion_r16960356 --- Diff: curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java --- @@ -580,13 +670,33 @@ public Void apply(TreeCacheListener listener) } /** - * Default behavior is just to log the exception - * - * @param e the exception + * Send an exception to any listeners, or else log the error if there are none. */ - protected void handleException(Throwable e) + private void handleException(final Throwable e) { - LOG.error("", e); + if ( errorListeners.size() == 0 ) + { + LOG.error("", e); + } + else + { + errorListeners.forEach(new Function() + { + @Override + public Void apply(UnhandledErrorListener listener) + { + try + { + listener.unhandledError("", e); + } + catch ( Exception e ) + { + LOG.error("Exception handling exception", e); + } + return null; + } + }); + } --- End diff -- That was kind of my thought. If we're not sure, I could make this package-protected for now. > TreeCache should use a builder for advanced options > --------------------------------------------------- > > Key: CURATOR-144 > URL: https://issues.apache.org/jira/browse/CURATOR-144 > Project: Apache Curator > Issue Type: Improvement > Components: Recipes > Reporter: Scott Blum > Priority: Minor > Original Estimate: 24h > Remaining Estimate: 24h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)