juergen 2002/06/26 09:10:50
Modified: src/webdav/server/org/apache/slide/webdav/method
PutMethod.java
Log:
print the stacktrace in case of jdk exceptions only (not in the case of a
SlideException).
Revision Changes Path
1.53 +11 -5
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java
Index: PutMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- PutMethod.java 14 Jun 2002 12:24:06 -0000 1.52
+++ PutMethod.java 26 Jun 2002 16:10:50 -0000 1.53
@@ -125,7 +125,7 @@
/**
* Constructor.
- *
+ *
* @param token the token for accessing the namespace
* @param config configuration of the WebDAV servlet
*/
@@ -386,6 +386,10 @@
sendPreconditionViolation(e);
throw e;
}
+ catch (SlideException e) {
+ resp.setStatus(getErrorCode(e)); // special handling needed
+ throw new WebdavException(WebdavStatus.SC_ACCEPTED, false); // abort
the TA
+ }
catch (Exception e) {
e.printStackTrace();
resp.setStatus(getErrorCode(e)); // special handling needed
@@ -452,7 +456,7 @@
/**
* Get return status based on exception type.
*/
- protected int getErrorCode(Exception ex) {
+ protected int getErrorCode(SlideException ex) {
try {
throw ex;
} catch (RevisionAlreadyExistException e) {
@@ -463,6 +467,8 @@
return WebdavStatus.SC_CONFLICT;
} catch (LinkedObjectNotFoundException e) {
return WebdavStatus.SC_NOT_FOUND;
+ } catch (SlideException e) {
+ return super.getErrorCode(e);
} catch (Exception e) {
return super.getErrorCode(e);
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>