[Libreoffice-commits] core.git: reportbuilder/java
Lionel Elie Mamane
lionel at mamane.lu
Wed Jan 21 09:28:13 PST 2015
reportbuilder/java/org/libreoffice/report/SOImageService.java | 4 +-
reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java | 16 ++++++++--
2 files changed, 15 insertions(+), 5 deletions(-)
New commits:
commit f4a2cff16ea546e7d0a135d4b061a65e783ab422
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Wed Jan 21 15:41:55 2015 +0100
Don't try to pass an arbitrary Java exception through UNO
also make other exceptions more verbose
Change-Id: Id6bf88b1ec228b20b19c89ccf6ee14d0c1ffb44d
diff --git a/reportbuilder/java/org/libreoffice/report/SOImageService.java b/reportbuilder/java/org/libreoffice/report/SOImageService.java
index 3cfdf35..f472d28 100644
--- a/reportbuilder/java/org/libreoffice/report/SOImageService.java
+++ b/reportbuilder/java/org/libreoffice/report/SOImageService.java
@@ -45,7 +45,7 @@ public class SOImageService implements ImageService
{
if (xCompContext == null)
{
- throw new ReportExecutionException();
+ throw new ReportExecutionException("SOImageService constructed with null Component Context");
}
@@ -55,7 +55,7 @@ public class SOImageService implements ImageService
if (m_xGraphicProvider == null)
{
- throw new ReportExecutionException("There is no graphic-provider available.");
+ throw new ReportExecutionException("There is no graphic-provider available for SOImageService.");
}
}
diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java b/reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java
index 68b1b17..1b53cc0 100644
--- a/reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java
+++ b/reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java
@@ -61,6 +61,10 @@ import com.sun.star.uno.XComponentContext;
import java.util.logging.Level;
import java.util.logging.Logger;
+import java.io.Writer;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -216,12 +220,18 @@ public class SOReportJobFactory
catch (java.lang.Exception e)
{
LOGGER.error("ReportProcessing failed", e);
- throw new com.sun.star.lang.WrappedTargetException(e, e.getMessage(), this, null);
+ Writer result = new StringWriter();
+ PrintWriter printWriter = new PrintWriter(result);
+ e.printStackTrace(printWriter);
+ throw new com.sun.star.lang.WrappedTargetException(e.toString() + '\n' + result.toString(), this, null);
}
- catch (java.lang.IncompatibleClassChangeError e2)
+ catch (java.lang.IncompatibleClassChangeError e)
{
LOGGER.error("Detected an IncompatibleClassChangeError");
- throw new com.sun.star.lang.WrappedTargetException(e2, "caught a " + e2.getClass().getName(), this, new com.sun.star.uno.Exception(e2.getLocalizedMessage()));
+ Writer result = new StringWriter();
+ PrintWriter printWriter = new PrintWriter(result);
+ e.printStackTrace(printWriter);
+ throw new com.sun.star.lang.WrappedTargetException(e.toString() + '\n' + result.toString(), this, null);
}
Thread.currentThread().setContextClassLoader(cl);
More information about the Libreoffice-commits
mailing list