#NEWLINE# @ staticmethod #NEWLINE# def get_twitter_error_details( data ) : #NEWLINE# #INDENT# ( code , msg ) = ( None , 'An unknown error has occured processing your request.' ) #NEWLINE# errors = ( data . get ( 'errors' ) if data else None ) #NEWLINE# if ( errors and isinstance ( errors , list ) ) : #NEWLINE# #INDENT# code = errors [ 0 ] [ 'code' ] #NEWLINE# msg = errors [ 0 ] [ 'message' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if errors : #NEWLINE# #INDENT# code = errors [ 'code' ] #NEWLINE# msg = errors [ 'message' ] #NEWLINE# #UNINDENT# #UNINDENT# return ( code , msg )