#NEWLINE# def _safe_config_get( self , callback , key , sect = 'Burp1' , cast = None ) : #NEWLINE# #INDENT# '\n        :func:`burpui.misc.backend.interface.BUIbackend._safe_config_get` is a\n        wrapper to handle Exceptions thrown by :mod:`ConfigParser`.\n\n        :param callback: Function to wrap\n        :type callback: callable\n\n        :param key: Key to retrieve\n        :type key: str\n\n        :param sect: Section of the config file to read\n        :type sect: str\n\n        :param cast: Cast the returned value if provided\n        :type case: callable\n\n        :returns: The value returned by the `callback`\n        ' #NEWLINE# try : #NEWLINE# #INDENT# return callback ( sect , key ) #NEWLINE# #UNINDENT# except ConfigParser . NoOptionError as e : #NEWLINE# #INDENT# self . _logger ( 'error' , str ( e ) ) #NEWLINE# #UNINDENT# except ConfigParser . NoSectionError as e : #NEWLINE# #INDENT# self . _logger ( 'warning' , str ( e ) ) #NEWLINE# if ( key in self . defaults ) : #NEWLINE# #INDENT# if cast : #NEWLINE# #INDENT# return cast ( self . defaults [ key ] ) #NEWLINE# #UNINDENT# return e . defaults [ key ] #NEWLINE# #UNINDENT# #UNINDENT# return None