clicrdv: catch a more precise exception, and add an explanation

This commit is contained in:
Frédéric Péters 2012-10-04 15:08:32 +02:00
parent aa18beb55c
commit 092eda8407
1 changed files with 4 additions and 1 deletions

View File

@ -345,7 +345,10 @@ class ClicRdvCancelAppointment(WorkflowStatusItem):
req.get_method = (lambda: 'DELETE')
fd = urllib2.urlopen(req)
none = fd.read()
except: # no idea what's the error that would be raised :/
except urllib2.URLError:
# clicrdv will return a "Bad Request" (HTTP 400) response
# when it's not possible to remove an appointment
# (for example because it's too late)
success = False
if (success and self.status_on_success) or (success is False and self.status_on_failure):