#NEWLINE# def parse_body( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# js = json . loads ( self . body ) #NEWLINE# if ( js [ js . keys ( ) [ 0 ] ] [ 'response_type' ] == 'ERROR' ) : #NEWLINE# #INDENT# raise RimuHostingException ( js [ js . keys ( ) [ 0 ] ] [ 'human_readable_message' ] ) #NEWLINE# #UNINDENT# return js [ js . keys ( ) [ 0 ] ] #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise RimuHostingException ( ( 'Could not parse body: %s' % self . body ) ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# raise RimuHostingException ( ( 'Could not parse body: %s' % js . body ) )