Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 191F217C64 for ; Fri, 17 Apr 2015 15:42:32 +0000 (UTC) Received: (qmail 61937 invoked by uid 500); 17 Apr 2015 15:42:32 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 61894 invoked by uid 500); 17 Apr 2015 15:42:32 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 61885 invoked by uid 99); 17 Apr 2015 15:42:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Apr 2015 15:42:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CA69FDFF6A; Fri, 17 Apr 2015 15:42:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chathuri@apache.org To: commits@airavata.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: airavata git commit: missing error savings - AIRAVATA-1672 Date: Fri, 17 Apr 2015 15:42:31 +0000 (UTC) Repository: airavata Updated Branches: refs/heads/master bd275a9a1 -> c8a17de16 missing error savings - AIRAVATA-1672 Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/c8a17de1 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/c8a17de1 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/c8a17de1 Branch: refs/heads/master Commit: c8a17de16bfaada4dc955af0026769caa41232ee Parents: bd275a9 Author: Chathuri Wimalasena Authored: Fri Apr 17 11:18:42 2015 -0400 Committer: Chathuri Wimalasena Committed: Fri Apr 17 11:18:42 2015 -0400 ---------------------------------------------------------------------- .../airavata/gfac/core/cpi/BetterGfacImpl.java | 44 +++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/c8a17de1/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java index 839e25f..8f89f9a 100644 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java +++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java @@ -990,6 +990,13 @@ public class BetterGfacImpl implements GFac,Watcher { jobExecutionContext.getExperimentID(), jobExecutionContext.getGatewayID()); monitorPublisher.publish(new TaskStatusChangeRequestEvent(TaskState.FAILED, taskIdentity)); + try { + StringWriter errors = new StringWriter(); + e.printStackTrace(new PrintWriter(errors)); + GFacUtils.saveErrorDetails(jobExecutionContext, errors.toString(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR); + } catch (GFacException e1) { + log.error(e1.getLocalizedMessage()); + } throw new GFacException(e); } }else{ @@ -1068,7 +1075,14 @@ public class BetterGfacImpl implements GFac,Watcher { monitorPublisher.publish(new GfacExperimentStateChangeRequest(new MonitorID(jobExecutionContext) , GfacExperimentState.INHANDLERSINVOKED)); } catch (Exception e) { - throw new GFacException("Error invoking ZK", e); + try { + StringWriter errors = new StringWriter(); + e.printStackTrace(new PrintWriter(errors)); + GFacUtils.saveErrorDetails(jobExecutionContext, errors.toString(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR); + } catch (GFacException e1) { + log.error(e1.getLocalizedMessage()); + } + throw new GFacException("Error while re-invoking output handlers", e); } } @@ -1113,16 +1127,44 @@ public class BetterGfacImpl implements GFac,Watcher { GFacUtils.updatePluginState(zk, jobExecutionContext, handlerClassName.getClassName(), GfacPluginState.COMPLETED); } } catch (ClassNotFoundException e) { + try { + StringWriter errors = new StringWriter(); + e.printStackTrace(new PrintWriter(errors)); + GFacUtils.saveErrorDetails(jobExecutionContext, errors.toString(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR); + } catch (GFacException e1) { + log.error(e1.getLocalizedMessage()); + } log.error(e.getMessage()); throw new GFacException("Cannot load handler class " + handlerClassName, e); } catch (InstantiationException e) { + try { + StringWriter errors = new StringWriter(); + e.printStackTrace(new PrintWriter(errors)); + GFacUtils.saveErrorDetails(jobExecutionContext, errors.toString(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR); + } catch (GFacException e1) { + log.error(e1.getLocalizedMessage()); + } log.error(e.getMessage()); throw new GFacException("Cannot instantiate handler class " + handlerClassName, e); } catch (IllegalAccessException e) { + try { + StringWriter errors = new StringWriter(); + e.printStackTrace(new PrintWriter(errors)); + GFacUtils.saveErrorDetails(jobExecutionContext, errors.toString(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR); + } catch (GFacException e1) { + log.error(e1.getLocalizedMessage()); + } log.error(e.getMessage()); throw new GFacException("Cannot instantiate handler class " + handlerClassName, e); } catch (Exception e) { // TODO: Better error reporting. + try { + StringWriter errors = new StringWriter(); + e.printStackTrace(new PrintWriter(errors)); + GFacUtils.saveErrorDetails(jobExecutionContext, errors.toString(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR); + } catch (GFacException e1) { + log.error(e1.getLocalizedMessage()); + } throw new GFacException("Error Executing a OutFlow Handler", e); } }