From 9341bf3dc38b2cc117ffbe12ff057511ed6e046d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 16 Oct 2014 12:19:14 +0200 Subject: java: when rethrowing, store the original exception Change-Id: I34ce000c48d2d79bfec854c8dd55d12f2bee29c7 --- xmerge/source/bridge/java/XMergeBridge.java | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'xmerge/source/bridge/java') diff --git a/xmerge/source/bridge/java/XMergeBridge.java b/xmerge/source/bridge/java/XMergeBridge.java index 30fe66b48d99..da0d31a180b8 100644 --- a/xmerge/source/bridge/java/XMergeBridge.java +++ b/xmerge/source/bridge/java/XMergeBridge.java @@ -312,11 +312,11 @@ public class XMergeBridge { } catch (IOException e){ - throw new com.sun.star.uno.RuntimeException(e.getMessage()); + throw new com.sun.star.uno.RuntimeException(e); } catch (Exception e){ - throw new com.sun.star.uno.RuntimeException("Xmerge Exception"); + throw new com.sun.star.uno.RuntimeException(e); } } @@ -476,13 +476,10 @@ public class XMergeBridge { } ConverterInfoMgr.removeByJar(jarName); } - catch (StackOverflowError sOE){ - System.out.println("\nERROR : Stack Overflow. \n Increase of the JRE by adding the following line to the end of the javarc file \n \"-Xss1m\"\n"); - - } - catch (Exception e) { - System.out.println("Error:"+e); - throw new IOException("Xmerge Exception"); + catch (Exception ex1) { + IOException ex2 = new IOException(); + ex2.initCause(ex1); + throw ex2; } } else{ @@ -513,9 +510,10 @@ public class XMergeBridge { catch (StackOverflowError sOE){ System.out.println("\nERROR : Stack Overflow. \n Increase of the JRE by adding the following line to the end of the javarc file \n \"-Xss1m\"\n"); } - catch (Exception e) { - System.out.println("Error:"+e); - throw new IOException("Xmerge Exception"); + catch (Exception ex1) { + IOException ex2 = new IOException(); + ex2.initCause(ex1); + throw ex2; } -- cgit