#NEWLINE# def process_exception( self , request , exception ) : #NEWLINE# #INDENT# if ( hasattr ( exception , 'to_json_error_msg' ) and callable ( exception . to_json_error_msg ) ) : #NEWLINE# #INDENT# return json_error ( exception . to_json_error_msg ( ) ) #NEWLINE# #UNINDENT# if ( request . error_format == 'JSON' ) : #NEWLINE# #INDENT# logging . error ( traceback . format_exc ( ) ) #NEWLINE# return json_error ( 'Internal server error' , status = 500 ) #NEWLINE# #UNINDENT# return None