comparison 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
comparison
equal deleted inserted replaced
1163:cd6dd7f66551 1164:ef3adc3f2078
2371 2371
2372 def registered(result): 2372 def registered(result):
2373 return C.REGISTRATION_SUCCEED 2373 return C.REGISTRATION_SUCCEED
2374 2374
2375 def registeringError(failure): 2375 def registeringError(failure):
2376 status = failure.value.faultString 2376 # FIXME: better error handling for bridge error is needed
2377 status = failure.value.fullname.split('.')[-1]
2377 if status == "ConflictError": 2378 if status == "ConflictError":
2378 return C.ALREADY_EXISTS 2379 return C.ALREADY_EXISTS
2380 elif status == "InvalidCertificate":
2381 return C.INVALID_CERTIFICATE
2379 elif status == "InternalError": 2382 elif status == "InternalError":
2380 return C.INTERNAL_ERROR 2383 return C.INTERNAL_ERROR
2381 else: 2384 else:
2382 log.error( 2385 log.error(
2383 _(u"Unknown registering error status: {status }").format( 2386 _(u"Unknown registering error status: {status }").format(