Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Commit

Permalink
Not the (unfortunately large number of) bare exceptions here as FIXME.
Browse files Browse the repository at this point in the history
raise instantiated exceptions.

git-svn-id: https://svn.calendarserver.org/repository/calendarserver/CalendarServer/trunk@2498 e27351fd-9f3e-4f54-a53b-843176b1656c
  • Loading branch information
Wilfredo Sanchez committed May 25, 2008
1 parent 7ee6466 commit 53e0a12
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions twistedcaldav/itip.py
Expand Up @@ -34,7 +34,6 @@
import md5 import md5
import time import time


from twisted.python import failure
from twisted.internet.defer import waitForDeferred, deferredGenerator, maybeDeferred from twisted.internet.defer import waitForDeferred, deferredGenerator, maybeDeferred
from twisted.web2.dav import davxml from twisted.web2.dav import davxml
from twisted.web2.dav.method.report import NumberOfMatchesWithinLimits from twisted.web2.dav.method.report import NumberOfMatchesWithinLimits
Expand Down Expand Up @@ -180,8 +179,9 @@ def processRequest(request, principal, inbox, calendar, child):
newInboxResource(child, newchild) newInboxResource(child, newchild)
processed = "processed" processed = "processed"
except: except:
log.err("Error while auto-processing iTIP: %s" % (failure.Failure(),)) # FIXME: bare except
raise iTipException log.err("Error while auto-processing iTIP: %s" % (Failure(),))
raise iTipException()


else: else:
# So we have a partial update. That means we have to do partial updates to instances in # So we have a partial update. That means we have to do partial updates to instances in
Expand Down Expand Up @@ -249,8 +249,9 @@ def processRequest(request, principal, inbox, calendar, child):


processed = "processed" processed = "processed"
except: except:
log.err("Error while auto-processing iTIP: %s" % (failure.Failure(),)) # FIXME: bare except
raise iTipException log.err("Error while auto-processing iTIP: %s" % (Failure(),))
raise iTipException()


# Remove the now processed incoming request. # Remove the now processed incoming request.
try: try:
Expand All @@ -266,8 +267,9 @@ def processRequest(request, principal, inbox, calendar, child):
}[processed] }[processed]
)) ))
except: except:
log.err("Error while auto-processing iTIP: %s" % (failure.Failure(),)) # FIXME: bare except
raise iTipException log.err("Error while auto-processing iTIP: %s" % (Failure(),))
raise iTipException()
yield None yield None
return return


Expand All @@ -286,7 +288,7 @@ def processAdd(request, principal, inbox, calendar, child):
""" """
log.info("Auto-processing iTIP ADD for: %s" % (str(principal),)) log.info("Auto-processing iTIP ADD for: %s" % (str(principal),))


raise NotImplementedError raise NotImplementedError()


processAdd = deferredGenerator(processAdd) processAdd = deferredGenerator(processAdd)


Expand Down Expand Up @@ -371,8 +373,9 @@ def processCancel(request, principal, inbox, calendar, child):
d.getResult() d.getResult()
log.info("Delete calendar component %s in %s as it was cancelled." % (calmatch, calURL)) log.info("Delete calendar component %s in %s as it was cancelled." % (calmatch, calURL))
except: except:
log.err("Error while auto-processing iTIP: %s" % (failure.Failure(),)) # FIXME: bare except
raise iTipException log.err("Error while auto-processing iTIP: %s" % (Failure(),))
raise iTipException()
processed = "processed" processed = "processed"
else: else:
processed = "older" processed = "older"
Expand Down Expand Up @@ -460,8 +463,9 @@ def processCancel(request, principal, inbox, calendar, child):
}[processed] }[processed]
)) ))
except: except:
log.err("Error while auto-processing iTIP: %s" % (failure.Failure(),)) # FIXME: bare except
raise iTipException log.err("Error while auto-processing iTIP: %s" % (Failure(),))
raise iTipException()
yield None yield None
return return


Expand Down Expand Up @@ -675,6 +679,7 @@ def writeResource(request, collURL, collection, name, calendar):
yield d yield d
d.getResult() d.getResult()
except: except:
# FIXME: bare except
yield None yield None
return return


Expand Down Expand Up @@ -757,8 +762,9 @@ def processOthersInInbox(info, newinfo, inbox, child):
d.getResult() d.getResult()
log.info("Deleted iTIP message %s in Inbox that was older than the new one." % (i[0],)) log.info("Deleted iTIP message %s in Inbox that was older than the new one." % (i[0],))
except: except:
log.err("Error while auto-processing iTIP: %s" % (failure.Failure(),)) # FIXME: bare except
raise iTipException log.err("Error while auto-processing iTIP: %s" % (Failure(),))
raise iTipException()
else: else:
# For any that are newer or the same, mark the new one to be deleted. # For any that are newer or the same, mark the new one to be deleted.
delete_child = True delete_child = True
Expand All @@ -771,8 +777,9 @@ def processOthersInInbox(info, newinfo, inbox, child):
d.getResult() d.getResult()
log.info("Deleted new iTIP message %s in Inbox because it was older than existing ones." % (child.fp.basename(),)) log.info("Deleted new iTIP message %s in Inbox because it was older than existing ones." % (child.fp.basename(),))
except: except:
log.err("Error while auto-processing iTIP: %s" % (failure.Failure(),)) # FIXME: bare except
raise iTipException log.err("Error while auto-processing iTIP: %s" % (Failure(),))
raise iTipException()


yield delete_child yield delete_child


Expand Down

0 comments on commit 53e0a12

Please sign in to comment.