diff src/plugins/plugin_misc_account.py @ 751:1def5b7edf9f

core, bridge: better GenericException handling
author Goffi <goffi@goffi.org>
date Tue, 17 Dec 2013 00:56:39 +0100
parents fe05afc3f0df
children bfabeedbf32e
line wrap: on
line diff
--- a/src/plugins/plugin_misc_account.py	Mon Dec 16 17:49:54 2013 +0100
+++ b/src/plugins/plugin_misc_account.py	Tue Dec 17 00:56:39 2013 +0100
@@ -79,7 +79,7 @@
             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 @@
             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)