Commit aed48cd2 authored by 's avatar

Got rid of sys.exc_*

parent c9fbe38d
......@@ -85,7 +85,7 @@
"""WebDAV support - resource objects."""
__version__='$Revision: 1.29 $'[11:-2]
__version__='$Revision: 1.30 $'[11:-2]
import sys, os, string, mimetypes, davcmds, ExtensionClass
from common import absattr, aq_base, urlfix, rfc1123_date
......@@ -259,20 +259,21 @@ class Resource(ExtensionClass.Base):
raise 'Conflict', 'Attempt to copy to an unknown namespace.'
except 'Not Found':
raise 'Conflict', 'Object ancestors must already exist.'
except: raise sys.exc_type, sys.exc_value
except:
t, v, tb=sys.exc_info()
raise t, v
if hasattr(parent, '__null_resource__'):
raise 'Conflict', 'Object ancestors must already exist.'
existing=hasattr(aq_base(parent), name)
if existing and oflag=='F':
raise 'Precondition Failed', 'Destination resource exists.'
try: parent._checkId(name, allow_dup=1)
except: raise 'Forbidden', sys.exc_value
except: raise 'Forbidden', sys.exc_info()[1]
try: parent._verifyObjectPaste(self, REQUEST)
except 'Unauthorized':
raise 'Unauthorized', sys.exc_value
except: raise 'Forbidden', sys.exc_value
#try: self._notifyOfCopyTo(parent, op=0)
#except: raise 'Forbidden', sys.exc_value
raise 'Unauthorized', sys.exc_info()[1]
except: raise 'Forbidden', sys.exc_info()[1]
ob=self._getCopy(parent)
ob.manage_afterClone(ob)
ob._setId(name)
......@@ -317,18 +318,19 @@ class Resource(ExtensionClass.Base):
raise 'Conflict', 'Attempt to move to an unknown namespace.'
except 'Not Found':
raise 'Conflict', 'The resource %s must exist.' % path
except: raise sys.exc_type, sys.exc_value
except:
t, v, tb=sys.exc_info()
raise t, v
if hasattr(parent, '__null_resource__'):
raise 'Conflict', 'The resource %s must exist.' % path
existing=hasattr(aq_base(parent), name)
if existing and flag=='F':
raise 'Precondition Failed', 'Resource %s exists.' % dest
try: parent._checkId(name, allow_dup=1)
except: raise 'Forbidden', sys.exc_value
except: raise 'Forbidden', sys.exc_info()[1]
try: parent._verifyObjectPaste(self, REQUEST)
except: raise 'Forbidden', sys.exc_value
#try: self._notifyOfCopyTo(parent, op=1)
#except: raise 'Forbidden', sys.exc_value
except: raise 'Forbidden', sys.exc_info()[1]
ob=aq_base(self._getCopy(parent))
self.aq_parent._delObject(absattr(self.id))
ob._setId(name)
......
......@@ -85,7 +85,7 @@
"""WebDAV xml request objects."""
__version__='$Revision: 1.7 $'[11:-2]
__version__='$Revision: 1.8 $'[11:-2]
import sys, os, string, regex
from common import absattr, aq_base, urlfix, urlbase
......@@ -126,7 +126,7 @@ class PropFind:
self.allprop=(not len(body))
if not body: return
try: root=XmlParser().parse(body)
except: raise 'Bad Request', sys.exc_value
except: raise 'Bad Request', sys.exc_info()[1]
e=root.elements('propfind', ns=dav)
if not e: raise 'Bad Request', 'Invalid xml request.'
e=e[0]
......@@ -227,7 +227,7 @@ class PropPatch:
def parse(self, request, dav='DAV:'):
body=request.get('BODY', '')
try: root=XmlParser().parse(body)
except: raise 'Bad Request', sys.exc_value
except: raise 'Bad Request', sys.exc_info()[1]
vals=self.values
e=root.elements('propertyupdate', ns=dav)
if not e: raise 'Bad Request', 'Invalid xml request.'
......@@ -288,12 +288,12 @@ class PropPatch:
if propset.hasProperty(name):
try: propset._updateProperty(name, val, meta=md)
except:
errors.append(str(sys.exc_value))
errors.append(str(sys.exc_info()[1]))
status='409 Conflict'
else:
try: propset._setProperty(name, val, meta=md)
except:
errors.append(str(sys.exc_value))
errors.append(str(sys.exc_info()[1]))
status='409 Conflict'
else:
name, ns=value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment