code: def _getattr(self, val, key, default_val):
          
          try:
              ret = getattr(val, key, default_val)
  
          except Exception as e:
              logger.exception(e)
              ret = default_val
  
          return ret
docs: wrapper around global getattr(...) method that suppresses any exception raised