Index: /main/waeup.cas/trunk/waeup/cas/authenticators.py
===================================================================
--- /main/waeup.cas/trunk/waeup/cas/authenticators.py	(revision 10509)
+++ /main/waeup.cas/trunk/waeup/cas/authenticators.py	(revision 10510)
@@ -2,4 +2,5 @@
 """
 import re
+import sys
 from pkg_resources import iter_entry_points
 try:
@@ -216,8 +217,15 @@
                              'email':student['email']}])
                     except xmlrpclib.Fault:
+                        faultstring = sys.exc_info()[1].faultString
+                        if not 'Username already exists' in faultstring:
+                            return (False, faultstring)
                         # user exists
                         pass
-                    result = moodle.core_user_get_users([
-                        {'key':'username', 'value':username}])
+                    try:
+                        result = moodle.core_user_get_users([
+                            {'key':'username', 'value':username}])
+                    except xmlrpclib.Fault:
+                        faultstring = sys.exc_info()[1].faultString
+                        return (False, faultstring)
                     user_id = result['users'][0]['id']
                     # Due to a lack of Moodle (Moodle requires an LDAP
@@ -225,6 +233,10 @@
                     # be set when the user is created. It must be updated
                     # after creation.
-                    result = moodle.core_user_update_users([
-                        {'id':user_id,'auth':'cas'}])
+                    try:
+                        result = moodle.core_user_update_users([
+                            {'id':user_id,'auth':'cas'}])
+                    except xmlrpclib.Fault:
+                        faultstring = sys.exc_info()[1].faultString
+                        return (False, faultstring)
                 return (True, '')
         return (False, 'Invalid username or password.')
