Return-Path: X-Original-To: apmail-streams-dev-archive@minotaur.apache.org Delivered-To: apmail-streams-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 C07BC11432 for ; Mon, 14 Jul 2014 14:20:14 +0000 (UTC) Received: (qmail 2080 invoked by uid 500); 14 Jul 2014 14:20:14 -0000 Delivered-To: apmail-streams-dev-archive@streams.apache.org Received: (qmail 2036 invoked by uid 500); 14 Jul 2014 14:20:14 -0000 Mailing-List: contact dev-help@streams.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@streams.incubator.apache.org Delivered-To: mailing list dev@streams.incubator.apache.org Received: (qmail 2022 invoked by uid 99); 14 Jul 2014 14:20:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jul 2014 14:20:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 14 Jul 2014 14:20:16 +0000 Received: (qmail 1392 invoked by uid 99); 14 Jul 2014 14:19:50 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jul 2014 14:19:50 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E344B8BDABF; Mon, 14 Jul 2014 14:19:49 +0000 (UTC) From: robdouglas To: dev@streams.incubator.apache.org Reply-To: dev@streams.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-streams pull request: Streams 132 Content-Type: text/plain Message-Id: <20140714141949.E344B8BDABF@tyr.zones.apache.org> Date: Mon, 14 Jul 2014 14:19:49 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org Github user robdouglas commented on a diff in the pull request: https://github.com/apache/incubator-streams/pull/54#discussion_r14879695 --- Diff: streams-contrib/streams-processor-regex/src/main/java/org/apache/streams/regex/AbstractRegexExtensionExtractor.java --- @@ -56,31 +61,43 @@ public String getPattern() { @Override public List process(StreamsDatum entry) { - if(!(entry.getDocument() instanceof Activity)) { - return Lists.newArrayList(); - } - if(Strings.isNullOrEmpty(pattern)) { - prepare(null); - } - Activity activity = (Activity)entry.getDocument(); - Map> matches = RegexUtils.extractMatches(pattern, activity.getContent()); - Collection entities = ensureTargetObject(activity); - for(String key : matches.keySet()) { - entities.add(prepareObject(key)); + try { + if (!(entry.getDocument() instanceof Activity)) { + return Lists.newArrayList(); + } + if (Strings.isNullOrEmpty(pattern)) { + prepare(null); + } + Activity activity = (Activity) entry.getDocument(); + Map> matches = RegexUtils.extractMatches(pattern, activity.getContent()); + Collection entities = ensureTargetObject(activity); + for (String key : matches.keySet()) { + entities.add(prepareObject(key)); + } + return Lists.newArrayList(entry); + } catch (Throwable e) { --- End diff -- My thought here was to catch any exceptions at the processor level to try and help narrow down where the exception was thrown and what caused it. However, in https://github.com/apache/incubator-streams/pull/55 I catch any processor exceptions in the StreamsProcessorTask class, so this try/catch may be unnecessary now --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---