#NEWLINE# def close( self ) : #NEWLINE# #INDENT# '\n        Close the client connection.\n\n        Raises:\n            ClientConnectionNotOpen: if the client connection is not open\n            Exception: if an error occurs while trying to close the connection\n        ' #NEWLINE# if ( not self . _is_open ) : #NEWLINE# #INDENT# raise exceptions . ClientConnectionNotOpen ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . proxy . close ( ) #NEWLINE# self . _is_open = False #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# self . logger . exception ( 'could not close client connection' , e ) #NEWLINE# raise e