diff --git a/combo/apps/search/models.py b/combo/apps/search/models.py index e1816ae8..f35e0867 100644 --- a/combo/apps/search/models.py +++ b/combo/apps/search/models.py @@ -155,6 +155,8 @@ class SearchCell(CellBase): # be set explicitely in the URL template in the engine definition (via # {{user_nameid}} or {{user_email}}). kwargs['without_user'] = True + # don't send error traces on HTTP errors + kwargs['log_errors'] = 'warn' results = requests.get(url, **kwargs).json() if service.get('data_key'): results['data'] = results.get(service['data_key']) or [] diff --git a/combo/utils/requests_wrapper.py b/combo/utils/requests_wrapper.py index 7d047f88..38827c2a 100644 --- a/combo/utils/requests_wrapper.py +++ b/combo/utils/requests_wrapper.py @@ -127,7 +127,10 @@ class Requests(RequestsSession): extra = {} if django_request: extra['request'] = django_request - logging.error('failed to %s %s (%s)', method, url, response.status_code, extra=extra) + if log_errors == 'warn': + logging.warning('failed to %s %s (%s)', method, url, response.status_code, extra=extra) + else: + logging.error('failed to %s %s (%s)', method, url, response.status_code, extra=extra) if method == 'GET' and cache_duration and (response.status_code // 100 == 2): cache.set(cache_key, response.content, cache_duration)