comparison src/memory/memory.py @ 751:1def5b7edf9f

core, bridge: better GenericException handling
author Goffi <goffi@goffi.org>
date Tue, 17 Dec 2013 00:56:39 +0100
parents 5aff0beddb28
children efa0e0f57950
comparison
equal deleted inserted replaced
750:c8b9f675ac17 751:1def5b7edf9f
162 - CONFLICT: the profile already exists 162 - CONFLICT: the profile already exists
163 - CANCELED: profile creation canceled 163 - CANCELED: profile creation canceled
164 """ 164 """
165 if self.storage.hasProfile(profile): 165 if self.storage.hasProfile(profile):
166 info(_('The profile name already exists')) 166 info(_('The profile name already exists'))
167 return defer.fail(Failure(u"CONFLICT")) 167 return defer.fail(Failure(exceptions.ConflictError))
168 if not self.host.trigger.point("ProfileCreation", profile): 168 if not self.host.trigger.point("ProfileCreation", profile):
169 return defer.fail(Failure(u"CANCEL")) 169 return defer.fail(Failure(exceptions.CancelError))
170 return self.storage.createProfile(profile) 170 return self.storage.createProfile(profile)
171 171
172 def deleteProfile(self, profile): 172 def deleteProfile(self, profile):
173 """Delete an existing profile 173 """Delete an existing profile
174 @param profile: name of the profile""" 174 @param profile: name of the profile"""