comparison libervia/server/server.py @ 1184:eee7a896cf0e

server: show BridgeException traceback on unknown registering status
author Goffi <goffi@goffi.org>
date Tue, 14 May 2019 19:40:51 +0200
parents 5cddb52dacbb
children ba45dcdbeeaf
comparison
equal deleted inserted replaced
1183:3b844004c0b4 1184:eee7a896cf0e
2370 return C.INVALID_INPUT 2370 return C.INVALID_INPUT
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 # FIXME: better error handling for bridge error is needed 2376 # FIXME: better error handling for bridge error is needed
2377 status = failure.value.fullname.split('.')[-1] 2377 status = failure_.value.fullname.split('.')[-1]
2378 if status == "ConflictError": 2378 if status == "ConflictError":
2379 return C.ALREADY_EXISTS 2379 return C.ALREADY_EXISTS
2380 elif status == "InvalidCertificate": 2380 elif status == "InvalidCertificate":
2381 return C.INVALID_CERTIFICATE 2381 return C.INVALID_CERTIFICATE
2382 elif status == "InternalError": 2382 elif status == "InternalError":
2383 return C.INTERNAL_ERROR 2383 return C.INTERNAL_ERROR
2384 else: 2384 else:
2385 log.error( 2385 log.error(
2386 _(u"Unknown registering error status: {status}").format( 2386 _(u"Unknown registering error status: {status}\n{traceback}").format(
2387 status=status 2387 status=status, traceback=failure_.value.message
2388 ) 2388 )
2389 ) 2389 )
2390 return status 2390 return status
2391 2391
2392 d = self.bridgeCall("registerSatAccount", email, password, login) 2392 d = self.bridgeCall("registerSatAccount", email, password, login)