core, bridge: better GenericException handling
This commit is contained in:
parent
09e5cc47bb
commit
b6aaecc5c2
6 changed files with 33 additions and 11 deletions
|
|
@ -79,7 +79,7 @@ class ProsodyRegisterProtocol(protocol.ProcessProtocol):
|
|||
self.deferred.callback(None)
|
||||
else:
|
||||
error(_(u"Can't register Prosody account (error code: %(code)d): %(message)s") % {'code': reason.value.exitCode, 'message': self.data})
|
||||
self.deferred.errback(Failure(u"INTERNAL"))
|
||||
self.deferred.errback(Failure(exceptions.InternalError))
|
||||
|
||||
|
||||
class MiscAccount(object):
|
||||
|
|
@ -118,7 +118,7 @@ class MiscAccount(object):
|
|||
raise exceptions.DataError
|
||||
|
||||
if profile.lower() in self.getConfig('reserved_list'):
|
||||
return defer.fail(Failure(u'CONFLICT'))
|
||||
return defer.fail(Failure(exceptions.ConflictError))
|
||||
|
||||
d = self.host.memory.asyncCreateProfile(profile)
|
||||
d.addCallback(self._profileRegistered, email, password, profile)
|
||||
|
|
|
|||
Loading…
Reference in a new issue