Mercurial > libervia-web
comparison src/server/server.py @ 793:249e49f56f67
browser and server sides: removed constant UNMANAGED_FAULT_STRING which is used only to be displayed to the user, but it doesn't mean anything to him
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 08 Dec 2015 00:12:51 +0100 |
parents | 2ddd85551612 |
children | 6a2fd7807770 |
comparison
equal
deleted
inserted
replaced
792:b993ff0fd02d | 793:249e49f56f67 |
---|---|
827 request.write(C.XMPP_AUTH_ERROR) | 827 request.write(C.XMPP_AUTH_ERROR) |
828 elif fault == 'NoReply': | 828 elif fault == 'NoReply': |
829 log.info(_("Did not receive a reply (the timeout expired or the connection is broken)")) | 829 log.info(_("Did not receive a reply (the timeout expired or the connection is broken)")) |
830 request.write(C.NO_REPLY) | 830 request.write(C.NO_REPLY) |
831 else: | 831 else: |
832 log.error(u'Unmanaged fault string %s in errback for the connection of profile %s' % (fault, profile)) | 832 log.error(u'Unmanaged fault string "%s" in errback for the connection of profile %s' % (fault, profile)) |
833 request.write(C.UNKNOWN_ERROR % fault) | 833 request.write(fault) |
834 request.finish() | 834 request.finish() |
835 | 835 |
836 self.waiting_profiles.setRequest(request, profile) | 836 self.waiting_profiles.setRequest(request, profile) |
837 d = self.asyncBridgeCall(connect_method, profile, password) | 837 d = self.asyncBridgeCall(connect_method, profile, password) |
838 d.addCallbacks(lambda connected: self._logged(profile, request) if connected else None, auth_eb) | 838 d.addCallbacks(lambda connected: self._logged(profile, request) if connected else None, auth_eb) |
845 @param request: request of the register form | 845 @param request: request of the register form |
846 @return: a constant indicating the state: | 846 @return: a constant indicating the state: |
847 - C.BAD_REQUEST: something is wrong in the request (bad arguments) | 847 - C.BAD_REQUEST: something is wrong in the request (bad arguments) |
848 - C.REGISTRATION_SUCCEED: new account has been successfully registered | 848 - C.REGISTRATION_SUCCEED: new account has been successfully registered |
849 - C.ALREADY_EXISTS: the given profile already exists | 849 - C.ALREADY_EXISTS: the given profile already exists |
850 - C.INTERNAL_ERROR or C.UNKNOWN_ERROR | 850 - C.INTERNAL_ERROR or any unmanaged fault string |
851 - server.NOT_DONE_YET: the profile is being processed, the return | 851 - server.NOT_DONE_YET: the profile is being processed, the return |
852 value will be given later (one of those previously described) | 852 value will be given later (one of those previously described) |
853 """ | 853 """ |
854 try: | 854 try: |
855 # XXX: for now libervia forces the creation to lower case | 855 # XXX: for now libervia forces the creation to lower case |
873 request.write(C.ALREADY_EXISTS) | 873 request.write(C.ALREADY_EXISTS) |
874 elif reason == "InternalError": | 874 elif reason == "InternalError": |
875 request.write(C.INTERNAL_ERROR) | 875 request.write(C.INTERNAL_ERROR) |
876 else: | 876 else: |
877 log.error(u'Unknown registering error: %s' % (reason,)) | 877 log.error(u'Unknown registering error: %s' % (reason,)) |
878 request.write(C.UNKNOWN_ERROR % reason) | 878 request.write(reason) |
879 request.finish() | 879 request.finish() |
880 | 880 |
881 d = self.asyncBridgeCall("registerSatAccount", email, password, profile) | 881 d = self.asyncBridgeCall("registerSatAccount", email, password, profile) |
882 d.addCallback(registered) | 882 d.addCallback(registered) |
883 d.addErrback(registeringError) | 883 d.addErrback(registeringError) |