diff libervia/server/server.py @ 1164:ef3adc3f2078

handle invalid certificate on registration + fixed error handling on registration
author Goffi <goffi@goffi.org>
date Sun, 03 Mar 2019 17:14:27 +0100
parents fb4b4da61132
children 5cddb52dacbb
line wrap: on
line diff
--- a/libervia/server/server.py	Sat Mar 02 18:44:20 2019 +0100
+++ b/libervia/server/server.py	Sun Mar 03 17:14:27 2019 +0100
@@ -2373,9 +2373,12 @@
             return C.REGISTRATION_SUCCEED
 
         def registeringError(failure):
-            status = failure.value.faultString
+            # FIXME: better error handling for bridge error is needed
+            status = failure.value.fullname.split('.')[-1]
             if status == "ConflictError":
                 return C.ALREADY_EXISTS
+            elif status == "InvalidCertificate":
+                return C.INVALID_CERTIFICATE
             elif status == "InternalError":
                 return C.INTERNAL_ERROR
             else: