summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-03-23 17:33:56 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-03-23 17:34:22 +0100
commitc65ae8762b5ce302d07bfa7f5432fd3560133dc2 (patch)
treeae23e8568524ac7fb22a4b9d7dcc2fc0a5133584 /scripting
parent9c327e138ec1877a0befe6ca6829a2ec674006a2 (diff)
Improve error reporting
Diffstat (limited to 'scripting')
-rw-r--r--scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java32
1 files changed, 23 insertions, 9 deletions
diff --git a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java
index 286d154ae521..71db25247b32 100644
--- a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java
+++ b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java
@@ -148,9 +148,11 @@ public abstract class ScriptProvider
catch ( Exception e )
{
LogUtils.DEBUG( LogUtils.getTrace( e ) );
- throw new com.sun.star.uno.RuntimeException(
- "Error constructing ScriptProvider: "
- + e.getMessage() );
+ com.sun.star.uno.RuntimeException e2 =
+ new com.sun.star.uno.RuntimeException(
+ "Error constructing ScriptProvider: " + e );
+ e2.initCause( e );
+ throw e2;
}
LogUtils.DEBUG( "ScriptProvider: constructor - finished." );
@@ -383,13 +385,21 @@ public abstract class ScriptProvider
catch ( com.sun.star.lang.IllegalArgumentException ila )
{
// TODO specify the correct error Type
- throw new ScriptFrameworkErrorException( ila.getMessage(),
- null, scriptURI, language, ScriptFrameworkErrorType.UNKNOWN );
+ ScriptFrameworkErrorException e2 =
+ new ScriptFrameworkErrorException(
+ ila.getMessage(), null, scriptURI, language,
+ ScriptFrameworkErrorType.UNKNOWN );
+ e2.initCause( ila );
+ throw e2;
}
catch ( com.sun.star.container.NoSuchElementException nse )
{
- throw new ScriptFrameworkErrorException( nse.getMessage(),
- null, details.function, language, ScriptFrameworkErrorType.NO_SUCH_SCRIPT );
+ ScriptFrameworkErrorException e2 =
+ new ScriptFrameworkErrorException(
+ nse.getMessage(), null, details.function, language,
+ ScriptFrameworkErrorType.NO_SUCH_SCRIPT );
+ e2.initCause( nse );
+ throw e2;
}
catch ( com.sun.star.lang.WrappedTargetException wta )
{
@@ -400,8 +410,12 @@ public abstract class ScriptProvider
{
message = wrapped.getMessage();
}
- throw new ScriptFrameworkErrorException( message,
- null, details.function, language, ScriptFrameworkErrorType.UNKNOWN );
+ ScriptFrameworkErrorException e2 =
+ new ScriptFrameworkErrorException(
+ message, null, details.function, language,
+ ScriptFrameworkErrorType.UNKNOWN );
+ e2.initCause( wta );
+ throw e2;
}
}