core, bridge: better GenericException handling

This commit is contained in:
Goffi 2013-12-17 00:56:39 +01:00
commit b6aaecc5c2
6 changed files with 33 additions and 11 deletions

View file

@ -164,9 +164,9 @@ class Params(object):
"""
if self.storage.hasProfile(profile):
info(_('The profile name already exists'))
return defer.fail(Failure(u"CONFLICT"))
return defer.fail(Failure(exceptions.ConflictError))
if not self.host.trigger.point("ProfileCreation", profile):
return defer.fail(Failure(u"CANCEL"))
return defer.fail(Failure(exceptions.CancelError))
return self.storage.createProfile(profile)
def deleteProfile(self, profile):