summaryrefslogtreecommitdiff
path: root/reportbuilder
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2015-01-21 15:41:55 +0100
committerLionel Elie Mamane <lionel@mamane.lu>2015-01-21 18:26:06 +0100
commitf4a2cff16ea546e7d0a135d4b061a65e783ab422 (patch)
treea7729123ffcd5f4b6a18a5aa2ec7400dc153f93e /reportbuilder
parentc743557389001ead9b6c2f384622efab8c7db829 (diff)
Don't try to pass an arbitrary Java exception through UNO
also make other exceptions more verbose Change-Id: Id6bf88b1ec228b20b19c89ccf6ee14d0c1ffb44d
Diffstat (limited to 'reportbuilder')
-rw-r--r--reportbuilder/java/org/libreoffice/report/SOImageService.java4
-rw-r--r--reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java16
2 files changed, 15 insertions, 5 deletions
diff --git a/reportbuilder/java/org/libreoffice/report/SOImageService.java b/reportbuilder/java/org/libreoffice/report/SOImageService.java
index 3cfdf35268a0..f472d284d02b 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 68b1b1729d1f..1b53cc06af17 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);