From 888ee07f65b76645129ddf3a96bd2d37211df983 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 16 Feb 2014 10:27:31 +0100 Subject: [PATCH] Check responsecodes --- couchpotato/core/plugins/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/plugins/base.py b/couchpotato/core/plugins/base.py index 0625535e..717a875f 100644 --- a/couchpotato/core/plugins/base.py +++ b/couchpotato/core/plugins/base.py @@ -172,7 +172,10 @@ class Plugin(object): log.info('Opening url: %s %s, data: %s', (method, url, [x for x in data.keys()] if isinstance(data, dict) else 'with data')) response = r.request(method, url, verify = False, **kwargs) - data = response.content + if response.status_code != requests.codes.ok: + data = response.content + else: + response.raise_for_status() self.http_failed_request[host] = 0 except (IOError, MaxRetryError, Timeout):