juergen 01/07/18 08:11:52
Modified: src/webdav/server/org/apache/slide/webdav/method
LockMethod.java
Log:
1) do not print a stacktrace in a pre_condition failed situation
2) make sure the transaction is aborted in case of an error
Revision Changes Path
1.14 +27 -5
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java
Index: LockMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- LockMethod.java 2001/07/18 14:36:32 1.13
+++ LockMethod.java 2001/07/18 15:11:52 1.14
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v
1.13 2001/07/18 14:36:32 juergen Exp $
- * $Revision: 1.13 $
- * $Date: 2001/07/18 14:36:32 $
+ * $Header:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v
1.14 2001/07/18 15:11:52 juergen Exp $
+ * $Revision: 1.14 $
+ * $Date: 2001/07/18 15:11:52 $
*
* ====================================================================
*
@@ -545,10 +545,26 @@
} catch (ObjectIsAlreadyLockedException e) {
resp.setStatus(WebdavStatus.SC_LOCKED);
- // e.printStackTrace();
- } catch (SlideException e) {
+ //
+ // make sure the transaction is aborted
+ // throw any WebDAV exception to indicate the transaction wants to
be aborted
+ //
+ throw new WebdavException(WebdavStatus.SC_ACCEPTED, false);
+ } catch (ObjectNotFoundException e) {
resp.setStatus(WebdavStatus.SC_PRECONDITION_FAILED);
+ //
+ // make sure the transaction is aborted
+ // throw any WebDAV exception to indicate the transaction wants to
be aborted
+ //
+ throw new WebdavException(WebdavStatus.SC_ACCEPTED, false);
+ } catch (SlideException e) {
+ resp.setStatus(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
e.printStackTrace();
+ //
+ // make sure the transaction is aborted
+ // throw any WebDAV exception to indicate the transaction wants to
be aborted
+ //
+ throw new WebdavException(WebdavStatus.SC_ACCEPTED, false);
}
break;
@@ -574,6 +590,11 @@
} catch (SlideException e) {
resp.setStatus(WebdavStatus.SC_PRECONDITION_FAILED);
e.printStackTrace();
+ //
+ // make sure the transaction is aborted
+ // throw any WebDAV exception to indicate the transaction wants to
be aborted
+ //
+ throw new WebdavException(WebdavStatus.SC_ACCEPTED, false);
}
break;
@@ -678,4 +699,5 @@
}
+