jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r818425 - in /jackrabbit/trunk: jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/ExceptionConverter.java jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/DavMethodBase.java
Date Thu, 24 Sep 2009 10:18:11 GMT
Author: jukka
Date: Thu Sep 24 10:18:10 2009
New Revision: 818425

URL: http://svn.apache.org/viewvc?rev=818425&view=rev
Log:
JCR-2318: Keep WebDAV exception causes

Modified:
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/ExceptionConverter.java
    jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/DavMethodBase.java

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/ExceptionConverter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/ExceptionConverter.java?rev=818425&r1=818424&r2=818425&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/ExceptionConverter.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/ExceptionConverter.java
Thu Sep 24 10:18:10 2009
@@ -88,16 +88,29 @@
                                        method instanceof PutMethod)) {
                     // target item has probably while transient changes have
                     // been made.
-                    throw new InvalidItemStateException(msg);
+                    throw new InvalidItemStateException(msg, davExc);
                 } else {
-                    return new ItemNotFoundException(msg);
+                    return new ItemNotFoundException(msg, davExc);
                 }
-            case DavServletResponse.SC_LOCKED : return new LockException(msg);
-            case DavServletResponse.SC_METHOD_NOT_ALLOWED : return new ConstraintViolationException(msg);
-            case DavServletResponse.SC_CONFLICT : return new InvalidItemStateException(msg);
-            case DavServletResponse.SC_PRECONDITION_FAILED : return new LockException(msg);
-            case DavServletResponse.SC_NOT_IMPLEMENTED: throw new UnsupportedOperationException("Missing
implementation. " + ((method != null) ? "Method " + method + " could not be executed." : ""));
-            default: return new RepositoryException(msg);
+            case DavServletResponse.SC_LOCKED :
+                return new LockException(msg, davExc);
+            case DavServletResponse.SC_METHOD_NOT_ALLOWED :
+                return new ConstraintViolationException(msg, davExc);
+            case DavServletResponse.SC_CONFLICT :
+                return new InvalidItemStateException(msg, davExc);
+            case DavServletResponse.SC_PRECONDITION_FAILED :
+                return new LockException(msg, davExc);
+            case DavServletResponse.SC_NOT_IMPLEMENTED:
+                if (method != null) {
+                    throw new UnsupportedOperationException(
+                            "Missing implementation: Method "
+                            + method + " could not be executed", davExc);
+                } else {
+                    throw new UnsupportedOperationException(
+                            "Missing implementation", davExc);
+                }
+            default:
+                return new RepositoryException(msg, davExc);
         }
     }
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/DavMethodBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/DavMethodBase.java?rev=818425&r1=818424&r2=818425&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/DavMethodBase.java
(original)
+++ jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/DavMethodBase.java
Thu Sep 24 10:18:10 2009
@@ -119,9 +119,14 @@
                 responseDocument = docBuilder.parse(in);
                 return responseDocument;
             } catch (ParserConfigurationException e) {
-                throw new IOException(e.getMessage());
+                IOException exception =
+                    new IOException("XML parser configuration error");
+                exception.initCause(e);
+                throw exception;
             } catch (SAXException e) {
-                throw new IOException(e.getMessage());
+                IOException exception = new IOException("XML parsing error");
+                exception.initCause(e);
+                throw exception;
             } finally {
                 in.close();
             }
@@ -206,7 +211,10 @@
             doc.appendChild(requestBody.toXml(doc));
             setRequestBody(doc);
         } catch (ParserConfigurationException e) {
-            throw new IOException(e.getMessage());
+            IOException exception =
+                new IOException("XML parser configuration error");
+            exception.initCause(e);
+            throw exception;
         }
     }
 



Mime
View raw message