#NEWLINE# def _onConnect( self , request ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# res = self . onConnect ( request ) #NEWLINE# #UNINDENT# except ConnectionDeny as e : #NEWLINE# #INDENT# self . failHandshake ( e . reason , e . code ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# self . failHandshake ( 'Internal server error: {}' . format ( e ) , ConnectionDeny . INTERNAL_SERVER_ERROR ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . succeedHandshake ( e )