You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by es...@apache.org on 2008/01/03 05:58:39 UTC

svn commit: r608339 - /portals/pluto/branches/pluto-1.1.x/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/castor/AbstractCastorDescriptorService.java

Author: esm
Date: Wed Jan  2 20:58:38 2008
New Revision: 608339

URL: http://svn.apache.org/viewvc?rev=608339&view=rev
Log:
[PLUTO-458]: Set initCause on IOE, and log.

Modified:
    portals/pluto/branches/pluto-1.1.x/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/castor/AbstractCastorDescriptorService.java

Modified: portals/pluto/branches/pluto-1.1.x/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/castor/AbstractCastorDescriptorService.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/castor/AbstractCastorDescriptorService.java?rev=608339&r1=608338&r2=608339&view=diff
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/castor/AbstractCastorDescriptorService.java (original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/castor/AbstractCastorDescriptorService.java Wed Jan  2 20:58:38 2008
@@ -103,9 +103,15 @@
                 object = unmarshaller.unmarshal(in);
             }
         }
-        catch(Exception me) {
-            me.printStackTrace();
-            throw new IOException(me.getMessage());
+        catch (IOException e) {
+            LOG.error(e.getMessage(), e);
+            throw e;
+        }
+        catch (Exception e) {
+            LOG.error(e.getMessage(), e);
+            IOException ioe = new IOException(e.getMessage());
+            ioe.initCause(e);
+            throw ioe;
         }
         finally {
             if(is != null) {
@@ -152,10 +158,14 @@
             castorConfig.getProperties().setProperty("org.exolab.castor.indent", "true");
             setCastorMarshallerOptions(marshaller, object);
             marshaller.marshal(object);
-        } catch(IOException io) {
-            throw io;
+        } catch (IOException e) {
+            LOG.error(e.getMessage(), e);
+            throw e;
         } catch (Exception e) {
-            throw new IOException(e.getMessage());
+            LOG.error(e.getMessage(), e);
+            IOException ioe = new IOException(e.getMessage());
+            ioe.initCause(e);            
+            throw ioe;
         }
         finally {
             writer.flush();