luetzkendorf    2005/05/27 10:20:19

  Modified:    src/webdav/server/org/apache/slide/webdav/util
                        WebdavUtils.java
  Log:
  error messages for VetoExpections are now derived from the exceptions cause
  (patch by Thomas Bellembois)
  
  Revision  Changes    Path
  1.39      +7 -3      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/WebdavUtils.java
  
  Index: WebdavUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/WebdavUtils.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- WebdavUtils.java  4 Apr 2005 13:36:30 -0000       1.38
  +++ WebdavUtils.java  27 May 2005 17:20:19 -0000      1.39
  @@ -40,6 +40,7 @@
   import org.apache.slide.common.SlideToken;
   import org.apache.slide.common.SlideTokenImpl;
   import org.apache.slide.content.Content;
  +import org.apache.slide.content.InsufficientStorageException;
   import org.apache.slide.content.NodeRevisionDescriptor;
   import org.apache.slide.content.NodeRevisionDescriptors;
   import org.apache.slide.event.VetoException;
  @@ -579,11 +580,14 @@
               return e.getStatusCode();
           } catch(MethodNotAllowedException e) {
               return WebdavStatus.SC_METHOD_NOT_ALLOWED;
  +        } catch(InsufficientStorageException e) {
  +            return WebdavStatus.SC_INSUFFICIENT_STORAGE;
           } catch(VetoException e) {
  -            // FIXME: Should be mapped to a matching error code
  -            return WebdavStatus.SC_NOT_ACCEPTABLE;
  +            if (e != e.getCause()) {
  +                return getErrorCode(e.getCause());
  +            }
  +             return WebdavStatus.SC_NOT_ACCEPTABLE;
           } catch(SlideException e) {
  -            //            e.printStackTrace();
               return WebdavStatus.SC_INTERNAL_SERVER_ERROR;
           }
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to