#NEWLINE# def handle_exception( self , e , result ) : #NEWLINE# #INDENT# for k in sorted ( result . thrift_spec ) : #NEWLINE# #INDENT# if ( result . thrift_spec [ k ] [ 1 ] == 'success' ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ( _ , exc_name , exc_cls , _ ) = result . thrift_spec [ k ] #NEWLINE# if isinstance ( _ , exc_cls ) : #NEWLINE# #INDENT# setattr ( result , exc_name , e ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise e