From b8ef508854e44edcb0f09a418a5d4e4695b8b4b4 Mon Sep 17 00:00:00 2001 From: "A. G" Date: Fri, 16 Jun 2017 19:45:35 +0100 Subject: [PATCH] when exception is thrown inside retrieve let's log it in details --- .../scala/com/neowit/apex/actions/RetrieveMetadata.scala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/neowit/apex/actions/RetrieveMetadata.scala b/src/main/scala/com/neowit/apex/actions/RetrieveMetadata.scala index f8151cdd..6ece325e 100644 --- a/src/main/scala/com/neowit/apex/actions/RetrieveMetadata.scala +++ b/src/main/scala/com/neowit/apex/actions/RetrieveMetadata.scala @@ -19,7 +19,7 @@ package com.neowit.apex.actions -import java.io.{File, FileOutputStream} +import java.io.{File, FileOutputStream, PrintWriter, StringWriter} import com.neowit.apex.{MetaXml, MetadataType} import com.neowit.utils._ @@ -225,7 +225,12 @@ class RefreshMetadata extends RetrieveMetadata { } } catch { case ex:Throwable => - println(ex) + val sw = new StringWriter + ex.printStackTrace(new PrintWriter(sw)) + val stackTraceStr = sw.toString + // dump exception information to log + logger.error(ex) + logger.error(stackTraceStr) //responseWriter.println("RESULT=FAILURE") //responseWriter.println(new Message(ERROR, ex.toString)) ActionFailure(ErrorMessage(ex.toString))