#NEWLINE# def _api_get( self , url ) : #NEWLINE# #INDENT# "Make a GET request to the Review Board Gateway API.\n\n        Delegate to the client's http_get function but first add a\n        PRIVATE-TOKEN in the header for authentication.\n        " #NEWLINE# try : #NEWLINE# #INDENT# ( data , headers ) = self . client . http_get ( url , headers = { #NEWLINE# #INDENT# 'PRIVATE-TOKEN' : self . _get_private_token ( ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# return ( data , headers ) #NEWLINE# #UNINDENT# except HTTPError as e : #NEWLINE# #INDENT# if ( e . code == 401 ) : #NEWLINE# #INDENT# raise AuthorizationError ( ugettext ( 'The login or password is incorrect.' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( e . code == 404 ) : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logging . warning ( 'Failed to execute a GET request at %s: %s' , url , e , exc_info = 1 ) #NEWLINE# raise