From 32ae87360c9b5c15bd5ef33ec9090e56ad6e1756 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 26 Oct 2015 23:21:55 +0100 Subject: [PATCH] http: Catch and log all requests exceptions --- mopidy/internal/http.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mopidy/internal/http.py b/mopidy/internal/http.py index e35b8561..751d04ce 100644 --- a/mopidy/internal/http.py +++ b/mopidy/internal/http.py @@ -29,7 +29,11 @@ def download(session, uri, timeout=1.0, chunk_size=4096): '%.3fs', uri, timeout) return None except requests.exceptions.InvalidSchema: - logger.warning('%s has an unsupported schema.', uri) + logger.warning('Download of %r failed due to unsupported schema', uri) + return None + except requests.exceptions.RequestException as exc: + logger.warning('Download of %r failed: %s', uri, exc) + logger.debug('Download exception details', exc_info=True) return None content = []